Skip to content
Snippets Groups Projects
Commit b0445fa2 authored by Krzysztof Mochocki's avatar Krzysztof Mochocki
Browse files

Update way of generating generated_ test directories

parent 4ceeab8c
No related branches found
No related tags found
1 merge request!80Draft: Remove notifications
# config automatically generated by helpy # config automatically generated by helpy
wallet-dir=/workspace/hive/tests/python/functional/beekeepy/handle/commandline/application_command_line_options/patterns wallet-dir=/workspace/helpy/tests/beekeepy_test/handle/commandline/application_command_line_options/patterns
unlock-timeout=900 unlock-timeout=900
unlock-interval=500 unlock-interval=500
webserver-http-endpoint=0.0.0.0:0 webserver-http-endpoint=0.0.0.0:0
......
...@@ -30,12 +30,14 @@ def _convert_test_name_to_directory_name(test_name: str) -> str: ...@@ -30,12 +30,14 @@ def _convert_test_name_to_directory_name(test_name: str) -> str:
@pytest.fixture(autouse=True) @pytest.fixture(autouse=True)
def working_directory(request: pytest.FixtureRequest) -> Path: def working_directory(request: pytest.FixtureRequest) -> Path:
name_of_directory = _convert_test_name_to_directory_name(request.node.name) name_of_directory = _convert_test_name_to_directory_name(request.node.name)
path_to_generated = request.node.path.parent / name_of_directory path_to_module_generated = request.node.path.parent / f"generated_{request.node.path.stem}"
if path_to_generated.exists(): path_to_module_generated.mkdir(exist_ok=True)
shutil.rmtree(path_to_generated) path_to_test_artifacts = path_to_module_generated / name_of_directory
path_to_generated.mkdir() if path_to_test_artifacts.exists():
assert isinstance(path_to_generated, Path), "given object is not Path" shutil.rmtree(path_to_test_artifacts)
return path_to_generated path_to_test_artifacts.mkdir()
assert isinstance(path_to_test_artifacts, Path), "given object is not Path"
return path_to_test_artifacts
def pytest_addoption(parser: pytest.Parser) -> None: def pytest_addoption(parser: pytest.Parser) -> None:
...@@ -47,7 +49,7 @@ def pytest_addoption(parser: pytest.Parser) -> None: ...@@ -47,7 +49,7 @@ def pytest_addoption(parser: pytest.Parser) -> None:
@pytest.fixture @pytest.fixture
def registered_apis() -> RegisteredApisT: def registered_apis() -> RegisteredApisT:
"""Return registered methods.""" """Return registered methods."""
return AbstractApi._get_registered_methods() return AbstractSyncApi._get_registered_methods()
@pytest.fixture @pytest.fixture
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment