-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a dummy repository to run the
upgrade_python
tests
- Loading branch information
1 parent
5ba30fc
commit a0c49c2
Showing
2 changed files
with
60 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# (C) Datadog, Inc. 2023-present | ||
# All rights reserved | ||
# Licensed under a 3-clause BSD style license (see LICENSE) | ||
import pytest | ||
|
||
from ddev.repo.core import Repository | ||
|
||
|
||
@pytest.fixture | ||
def fake_repo(tmp_path_factory, config_file, ddev): | ||
repo_path = tmp_path_factory.mktemp('integrations-core') | ||
repo = Repository('integrations-core', str(repo_path)) | ||
|
||
config_file.model.repos['core'] = str(repo.path) | ||
config_file.save() | ||
|
||
write_file(repo_path / 'ddev' / 'src' / 'ddev' / 'repo', 'constants.py', """# (C) Datadog, Inc. 2022-present | ||
# All rights reserved | ||
# Licensed under a 3-clause BSD style license (see LICENSE) | ||
CONFIG_DIRECTORY = '.ddev' | ||
NOT_SHIPPABLE = frozenset(['datadog_checks_dev', 'datadog_checks_tests_helper', 'ddev']) | ||
FULL_NAMES = { | ||
'core': 'integrations-core', | ||
'extras': 'integrations-extras', | ||
'marketplace': 'marketplace', | ||
'agent': 'datadog-agent', | ||
} | ||
# This is automatically maintained | ||
PYTHON_VERSION = '3.9' | ||
""") | ||
|
||
write_file(repo_path / 'dummy', 'hatch.toml', """[env.collectors.datadog-checks] | ||
[[envs.default.matrix]] | ||
python = ["2.7", "3.9"] | ||
""") | ||
|
||
yield repo | ||
|
||
|
||
def write_file(folder, file, content): | ||
folder.mkdir(exist_ok=True, parents=True) | ||
file_path = folder / file | ||
file_path.write_text(content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters