From e56c79a1aff86d4a7878759ac536848e62871abf Mon Sep 17 00:00:00 2001 From: Fabio Tesser Date: Wed, 6 Oct 2021 22:24:29 +0200 Subject: [PATCH 01/13] Fixed typo. --- tests/test_04_automark.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_04_automark.py b/tests/test_04_automark.py index 7251405..edb2129 100644 --- a/tests/test_04_automark.py +++ b/tests/test_04_automark.py @@ -60,7 +60,7 @@ def test_b(): def test_set_true(ctestdir): - """A pytest.ini is present, automark_dependency is set to false. + """A pytest.ini is present, automark_dependency is set to true. Since automark_dependency is set to true, the outcome of test_a will be recorded, even though it is not marked. As a result, From bbf9b202243ae27508ab094da2c24ebafe5fdc55 Mon Sep 17 00:00:00 2001 From: Fabio Tesser Date: Wed, 6 Oct 2021 22:31:46 +0200 Subject: [PATCH 02/13] Added collect_dependencies feature. --- pytest_dependency.py | 30 ++++- tests/test_05_collect_dependencies.py | 161 ++++++++++++++++++++++++++ 2 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 tests/test_05_collect_dependencies.py diff --git a/pytest_dependency.py b/pytest_dependency.py index 9ebf94a..8b54c87 100644 --- a/pytest_dependency.py +++ b/pytest_dependency.py @@ -143,7 +143,10 @@ def pytest_addoption(parser): parser.addini("automark_dependency", "Add the dependency marker to all tests automatically", default=False) - parser.addoption("--ignore-unknown-dependency", + parser.addini("collect_dependencies", + "Collect the dependent' tests", + default=False) + parser.addoption("--ignore-unknown-dependency", action="store_true", default=False, help="ignore dependencies whose outcome is not known") @@ -184,3 +187,28 @@ def pytest_runtest_setup(item): scope = marker.kwargs.get('scope', 'module') manager = DependencyManager.getManager(item, scope=scope) manager.checkDepend(depends, item) + + +def collect_dependencies(item, items): + dependencies = list() + markers = item.own_markers + for marker in markers: + depends = marker.kwargs.get('depends') + parent = item.parent + if marker.name == 'dependency' and depends: + for depend in depends: + dependencies.append((depend, parent)) + + for dependency, parent in dependencies: + if dependency not in [item_i.name for item_i in items]: + item_to_add = pytest.Function.from_parent(name=dependency, parent=parent) + items.insert(0, item_to_add) + # recursive look for dependencies into item_to_add + collect_dependencies(item_to_add, items) + return + + +def pytest_collection_modifyitems(config, items): + if _get_bool(config.getini('collect_dependencies')): + for item in items: + collect_dependencies(item, items) diff --git a/tests/test_05_collect_dependencies.py b/tests/test_05_collect_dependencies.py new file mode 100644 index 0000000..89da289 --- /dev/null +++ b/tests/test_05_collect_dependencies.py @@ -0,0 +1,161 @@ +"""Test the collect_dependencies option. +""" + +import pytest + + +def test_no_set_collect_dependencies(ctestdir): + """No pytest.ini file, e.g. collect_dependencies is not set. + + Explicitly select only a single test that depends on another one. + Since collect_dependencies defaults to false, and the other test has not been run at all, the selected test + will be skipped. + + """ + ctestdir.makepyfile(""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + @pytest.mark.dependency() + def test_b(): + pass + + @pytest.mark.dependency() + def test_c(): + pass + + @pytest.mark.dependency(depends=["test_c"]) + def test_d(): + pass + """) + result = ctestdir.runpytest("--verbose", "test_no_set_collect_dependencies.py::test_d") + result.assert_outcomes(passed=0, skipped=1, failed=0) + result.stdout.re_match_lines(r""" + .*::test_d SKIPPED(?:\s+\(.*\))? + """) + + +def test_collect_dependencies_false(ctestdir): + """A pytest.ini is present, collect_dependencies is set to false. + + Explicitly select only a single test that depends on another one. + Since collect_dependencies is set to false, and the other test has not been run at all, the selected test + will be skipped. + + """ + ctestdir.makefile('.ini', pytest=""" + [pytest] + collect_dependencies = false + console_output_style = classic + """) + + ctestdir.makepyfile(""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + @pytest.mark.dependency() + def test_b(): + pass + + @pytest.mark.dependency() + def test_c(): + pass + + @pytest.mark.dependency(depends=["test_c"]) + def test_d(): + pass + """) + result = ctestdir.runpytest("--verbose", "test_collect_dependencies_false.py::test_d") + result.assert_outcomes(passed=0, skipped=1, failed=0) + result.stdout.re_match_lines(r""" + .*::test_d SKIPPED(?:\s+\(.*\))? + """) + + + + +def test_collect_dependencies_true(ctestdir): + """A pytest.ini is present, collect_dependencies is set to true. + + Explicitly select only a single test that depends on another one. + Since collect_dependencies is set to true, the other test will be collected, and both tests will be run. + """ + ctestdir.makefile('.ini', pytest=""" + [pytest] + collect_dependencies = true + console_output_style = classic + """) + + ctestdir.makepyfile(""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + @pytest.mark.dependency() + def test_b(): + pass + + @pytest.mark.dependency() + def test_c(): + pass + + @pytest.mark.dependency(depends=["test_c"]) + def test_d(): + pass + """) + result = ctestdir.runpytest("--verbose", "test_collect_dependencies_true.py::test_d") + result.assert_outcomes(passed=2, skipped=0, failed=0) + result.stdout.re_match_lines(r""" + .*::test_c PASSED + .*::test_d PASSED + """) + + +def test_collect_dependencies_true_recursive(ctestdir): + """A pytest.ini is present, collect_dependencies is set to true. + + Explicitly select only a single test that depends on another one, that depends from others two. + Since collect_dependencies is set to true, the dependent tests will be recursively collected, and four tests will be run. + """ + ctestdir.makefile('.ini', pytest=""" + [pytest] + collect_dependencies = true + console_output_style = classic + """) + + ctestdir.makepyfile(""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + @pytest.mark.dependency() + def test_b(): + pass + + @pytest.mark.dependency(depends=["test_b", "test_a"]) + def test_c(): + pass + + @pytest.mark.dependency(depends=["test_c"]) + def test_d(): + pass + """) + result = ctestdir.runpytest("--verbose", "test_collect_dependencies_true_recursive.py::test_d") + print(result) + result.assert_outcomes(passed=4, skipped=0, failed=0) + result.stdout.re_match_lines(r""" + .*::test_a PASSED + .*::test_b PASSED + .*::test_c PASSED + .*::test_d PASSED + """) From 5f6bf431d8200e279b7ef42d140a0c8fe1fdca94 Mon Sep 17 00:00:00 2001 From: Fabio Tesser Date: Wed, 15 Dec 2021 22:19:09 +0100 Subject: [PATCH 03/13] Added support for session scoped dependencies into the collect_dependencies feature. --- pytest_dependency.py | 25 +- tests/test_05_collect_dependencies.py | 351 ++++++++++++++++++++++++++ 2 files changed, 370 insertions(+), 6 deletions(-) diff --git a/pytest_dependency.py b/pytest_dependency.py index 8b54c87..9f0619e 100644 --- a/pytest_dependency.py +++ b/pytest_dependency.py @@ -4,6 +4,8 @@ import logging import pytest +from _pytest.python import Module +import py logger = logging.getLogger(__name__) @@ -194,14 +196,25 @@ def collect_dependencies(item, items): markers = item.own_markers for marker in markers: depends = marker.kwargs.get('depends') - parent = item.parent + scope = marker.kwargs.get('scope') if marker.name == 'dependency' and depends: for depend in depends: - dependencies.append((depend, parent)) - - for dependency, parent in dependencies: - if dependency not in [item_i.name for item_i in items]: - item_to_add = pytest.Function.from_parent(name=dependency, parent=parent) + if scope == 'session' or scope == 'package': + depend_module, depend_func = depend.split("::", 1) + depend_path = py.path.local(depend_module) + depend_parent = Module.from_parent(item.parent, fspath=depend_path) + depend_nodeid = depend + else: + depend_func = depend + depend_parent = item.parent + depend_nodeid = '{}::{}'.format(depend_parent.nodeid, depend_func) + # assert depend_nodeid == depend_nodeid2 + dependencies.append((depend_func, depend_nodeid, depend_parent)) + + for depend_func, depend_nodeid, depend_parent in dependencies: + list_of_items_nodeid = [item_i.nodeid for item_i in items] + if depend_nodeid not in list_of_items_nodeid: + item_to_add = pytest.Function.from_parent(name=depend_func, parent=depend_parent) items.insert(0, item_to_add) # recursive look for dependencies into item_to_add collect_dependencies(item_to_add, items) diff --git a/tests/test_05_collect_dependencies.py b/tests/test_05_collect_dependencies.py index 89da289..db87558 100644 --- a/tests/test_05_collect_dependencies.py +++ b/tests/test_05_collect_dependencies.py @@ -159,3 +159,354 @@ def test_d(): .*::test_c PASSED .*::test_d PASSED """) + + +def test_scope_session_collect_dependencies_true(ctestdir): + """Two modules, some cross module dependencies in session scope. + """ + ctestdir.makefile('.ini', pytest=""" + [pytest] + collect_dependencies = true + console_output_style = classic + """) + ctestdir.makepyfile(test_scope_session_01=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + @pytest.mark.dependency() + def test_b(): + assert False + + @pytest.mark.dependency(depends=["test_a"]) + def test_c(): + pass + + class TestClass(object): + + @pytest.mark.dependency() + def test_b(self): + pass + """, test_scope_session_02=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + assert False + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::test_a", + "test_scope_session_01.py::test_c"], + scope='session' + ) + def test_e(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::test_b"], + scope='session' + ) + def test_f(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_02.py::test_e"], + scope='session' + ) + def test_g(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::TestClass::test_b"], + scope='session' + ) + def test_h(): + pass + """) + result = ctestdir.runpytest("--verbose") + result.assert_outcomes(passed=6, skipped=1, failed=2) + result.stdout.re_match_lines(r""" + test_scope_session_01.py::test_a PASSED + test_scope_session_01.py::test_b FAILED + test_scope_session_01.py::test_c PASSED + test_scope_session_01.py::TestClass::test_b PASSED + test_scope_session_02.py::test_a FAILED + test_scope_session_02.py::test_e PASSED + test_scope_session_02.py::test_f SKIPPED(?:\s+\(.*\))? + test_scope_session_02.py::test_g PASSED + test_scope_session_02.py::test_h PASSED + """) + +def test_scope_session_collect_dependencies_true_single_test_run_1(ctestdir): + """Two modules, some cross module dependencies in session scope. + """ + ctestdir.makefile('.ini', pytest=""" + [pytest] + collect_dependencies = true + console_output_style = classic + """) + ctestdir.makepyfile(test_scope_session_01=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + """, test_scope_session_02=""" + import pytest + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::test_a"], + scope='session' + ) + def test_b(): + pass + + """) + + result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_b") + print(result) + result.assert_outcomes(passed=2, skipped=0, failed=0) + result.stdout.re_match_lines(r""" + test_scope_session_01.py::test_a PASSED + test_scope_session_02.py::test_b PASSED + """) + + +def test_scope_session_collect_dependencies_true_single_test_run_2(ctestdir): + """Two modules, some cross module dependencies in session scope. + """ + ctestdir.makefile('.ini', pytest=""" + [pytest] + collect_dependencies = true + console_output_style = classic + """) + ctestdir.makepyfile(test_scope_session_01=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + """, test_scope_session_02=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::test_a", "test_scope_session_02.py::test_a"], + scope='session' + ) + def test_b(): + pass + + """) + + result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_b") + print(result) + result.assert_outcomes(passed=3, skipped=0, failed=0) + result.stdout.re_match_lines(r""" + test_scope_session_02.py::test_a PASSED + test_scope_session_01.py::test_a PASSED + test_scope_session_02.py::test_b PASSED + """) + + +def test_scope_session_collect_dependencies_true_single_test_run_3(ctestdir): + """Two modules, some cross module dependencies in session scope. + """ + ctestdir.makefile('.ini', pytest=""" + [pytest] + collect_dependencies = true + console_output_style = classic + """) + ctestdir.makepyfile(test_scope_session_01=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + @pytest.mark.dependency(depends=["test_a"]) + def test_b(): + pass + + """, test_scope_session_02=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::test_b", "test_scope_session_02.py::test_a"], + scope='session' + ) + def test_b(): + pass + + """) + + result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_b") + print(result) + result.assert_outcomes(passed=4, skipped=0, failed=0) + result.stdout.re_match_lines(r""" + test_scope_session_02.py::test_a PASSED + test_scope_session_01.py::test_a PASSED + test_scope_session_01.py::test_b PASSED + test_scope_session_02.py::test_b PASSED + """) + + + + + +def test_scope_session_collect_dependencies_true_single_test_run_4a(ctestdir): + """Two modules, some cross module dependencies in session scope. + """ + ctestdir.makefile('.ini', pytest=""" + [pytest] + collect_dependencies = true + console_output_style = classic + """) + ctestdir.makepyfile(test_scope_session_01=""" + import pytest + + @pytest.mark.dependency(depends=["test_c"]) + def test_a(): + pass + + @pytest.mark.dependency() + def test_b(): + assert False + + @pytest.mark.dependency() + def test_c(): + pass + + class TestClass(object): + + @pytest.mark.dependency() + def test_b(self): + pass + """, test_scope_session_02=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + assert False + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::test_a", + "test_scope_session_01.py::test_c"], + scope='session' + ) + def test_e(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::test_b"], + scope='session' + ) + def test_f(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_02.py::test_e"], + scope='session' + ) + def test_g(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::TestClass::test_b"], + scope='session' + ) + def test_h(): + pass + """) + result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_e") + print(result) + result.assert_outcomes(passed=3, skipped=0, failed=0) + result.stdout.re_match_lines(r""" + test_scope_session_01.py::test_c PASSED + test_scope_session_01.py::test_a PASSED + test_scope_session_02.py::test_e PASSED + """) + + +def test_scope_session_collect_dependencies_true_single_test_run_4b(ctestdir): + """Two modules, some cross module dependencies in session scope. + """ + ctestdir.makefile('.ini', pytest=""" + [pytest] + collect_dependencies = true + console_output_style = classic + """) + ctestdir.makepyfile(test_scope_session_01=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + pass + + @pytest.mark.dependency() + def test_b(): + assert False + + @pytest.mark.dependency(depends=["test_scope_session_01.py::test_a"], scope='session') + def test_c(): + pass + + class TestClass(object): + + @pytest.mark.dependency() + def test_b(self): + pass + """, test_scope_session_02=""" + import pytest + + @pytest.mark.dependency() + def test_a(): + assert False + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::test_a", + "test_scope_session_01.py::test_c"], + scope='session' + ) + def test_e(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::test_b"], + scope='session' + ) + def test_f(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_02.py::test_e"], + scope='session' + ) + def test_g(): + pass + + @pytest.mark.dependency( + depends=["test_scope_session_01.py::TestClass::test_b"], + scope='session' + ) + def test_h(): + pass + """) + result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_e", "--order-dependencies") + print(result) + result.assert_outcomes(passed=3, skipped=0, failed=0) + result.stdout.re_match_lines(r""" + test_scope_session_01.py::test_a PASSED + test_scope_session_01.py::test_c PASSED + test_scope_session_02.py::test_e PASSED + """) From 16321bccd0f45550ee00492d708cfbc18e69ac5a Mon Sep 17 00:00:00 2001 From: Fabio Tesser Date: Wed, 15 Dec 2021 22:20:20 +0100 Subject: [PATCH 04/13] Reformat pytest_dependency.py --- pytest_dependency.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pytest_dependency.py b/pytest_dependency.py index 9f0619e..05b337a 100644 --- a/pytest_dependency.py +++ b/pytest_dependency.py @@ -3,9 +3,10 @@ __version__ = "$VERSION" import logging + +import py import pytest from _pytest.python import Module -import py logger = logging.getLogger(__name__) @@ -34,7 +35,7 @@ class DependencyItemStatus(object): Phases = ('setup', 'call', 'teardown') def __init__(self): - self.results = { w:None for w in self.Phases } + self.results = {w: None for w in self.Phases} def __str__(self): l = ["%s: %s" % (w, self.results[w]) for w in self.Phases] @@ -142,14 +143,14 @@ def depends(request, other, scope='module'): def pytest_addoption(parser): - parser.addini("automark_dependency", - "Add the dependency marker to all tests automatically", + parser.addini("automark_dependency", + "Add the dependency marker to all tests automatically", default=False) parser.addini("collect_dependencies", "Collect the dependent' tests", default=False) parser.addoption("--ignore-unknown-dependency", - action="store_true", default=False, + action="store_true", default=False, help="ignore dependencies whose outcome is not known") @@ -157,7 +158,7 @@ def pytest_configure(config): global _automark, _ignore_unknown _automark = _get_bool(config.getini("automark_dependency")) _ignore_unknown = config.getoption("--ignore-unknown-dependency") - config.addinivalue_line("markers", + config.addinivalue_line("markers", "dependency(name=None, depends=[]): " "mark a test to be used as a dependency for " "other tests or to depend on other tests.") From 4d72ebeff1a30e0e4e9501e5f1dd4795a993bec4 Mon Sep 17 00:00:00 2001 From: Fabio Tesser Date: Thu, 16 Dec 2021 00:00:35 +0100 Subject: [PATCH 05/13] Compose dependet path starting from rootdir. --- pytest_dependency.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pytest_dependency.py b/pytest_dependency.py index 05b337a..3125d0e 100644 --- a/pytest_dependency.py +++ b/pytest_dependency.py @@ -3,6 +3,7 @@ __version__ = "$VERSION" import logging +from pathlib import Path import py import pytest @@ -192,7 +193,7 @@ def pytest_runtest_setup(item): manager.checkDepend(depends, item) -def collect_dependencies(item, items): +def collect_dependencies(config, item, items): dependencies = list() markers = item.own_markers for marker in markers: @@ -202,7 +203,7 @@ def collect_dependencies(item, items): for depend in depends: if scope == 'session' or scope == 'package': depend_module, depend_func = depend.split("::", 1) - depend_path = py.path.local(depend_module) + depend_path = py.path.local(Path(config.rootdir) / Path(depend_module)) depend_parent = Module.from_parent(item.parent, fspath=depend_path) depend_nodeid = depend else: @@ -218,11 +219,11 @@ def collect_dependencies(item, items): item_to_add = pytest.Function.from_parent(name=depend_func, parent=depend_parent) items.insert(0, item_to_add) # recursive look for dependencies into item_to_add - collect_dependencies(item_to_add, items) + collect_dependencies(config, item_to_add, items) return def pytest_collection_modifyitems(config, items): if _get_bool(config.getini('collect_dependencies')): for item in items: - collect_dependencies(item, items) + collect_dependencies(config, item, items) From 04ea772a13af075ddfd9714bf0a456c27636b047 Mon Sep 17 00:00:00 2001 From: Fabio Tesser Date: Thu, 16 Dec 2021 09:14:06 +0100 Subject: [PATCH 06/13] Removed print(result). --- tests/test_05_collect_dependencies.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/test_05_collect_dependencies.py b/tests/test_05_collect_dependencies.py index db87558..8911fa0 100644 --- a/tests/test_05_collect_dependencies.py +++ b/tests/test_05_collect_dependencies.py @@ -151,7 +151,6 @@ def test_d(): pass """) result = ctestdir.runpytest("--verbose", "test_collect_dependencies_true_recursive.py::test_d") - print(result) result.assert_outcomes(passed=4, skipped=0, failed=0) result.stdout.re_match_lines(r""" .*::test_a PASSED @@ -266,7 +265,6 @@ def test_b(): """) result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_b") - print(result) result.assert_outcomes(passed=2, skipped=0, failed=0) result.stdout.re_match_lines(r""" test_scope_session_01.py::test_a PASSED @@ -306,7 +304,6 @@ def test_b(): """) result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_b") - print(result) result.assert_outcomes(passed=3, skipped=0, failed=0) result.stdout.re_match_lines(r""" test_scope_session_02.py::test_a PASSED @@ -351,7 +348,6 @@ def test_b(): """) result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_b") - print(result) result.assert_outcomes(passed=4, skipped=0, failed=0) result.stdout.re_match_lines(r""" test_scope_session_02.py::test_a PASSED @@ -429,7 +425,6 @@ def test_h(): pass """) result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_e") - print(result) result.assert_outcomes(passed=3, skipped=0, failed=0) result.stdout.re_match_lines(r""" test_scope_session_01.py::test_c PASSED @@ -503,7 +498,6 @@ def test_h(): pass """) result = ctestdir.runpytest("--verbose", "test_scope_session_02.py::test_e", "--order-dependencies") - print(result) result.assert_outcomes(passed=3, skipped=0, failed=0) result.stdout.re_match_lines(r""" test_scope_session_01.py::test_a PASSED From bf98db602e980d87092c6e2e57380b17211d86bc Mon Sep 17 00:00:00 2001 From: Fabio Tesser Date: Thu, 16 Dec 2021 09:14:54 +0100 Subject: [PATCH 07/13] Reformatting code. --- tests/test_05_collect_dependencies.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/test_05_collect_dependencies.py b/tests/test_05_collect_dependencies.py index 8911fa0..faa5801 100644 --- a/tests/test_05_collect_dependencies.py +++ b/tests/test_05_collect_dependencies.py @@ -78,8 +78,6 @@ def test_d(): """) - - def test_collect_dependencies_true(ctestdir): """A pytest.ini is present, collect_dependencies is set to true. @@ -238,6 +236,7 @@ def test_h(): test_scope_session_02.py::test_h PASSED """) + def test_scope_session_collect_dependencies_true_single_test_run_1(ctestdir): """Two modules, some cross module dependencies in session scope. """ @@ -357,9 +356,6 @@ def test_b(): """) - - - def test_scope_session_collect_dependencies_true_single_test_run_4a(ctestdir): """Two modules, some cross module dependencies in session scope. """ From fa63c66075553a6acc68df728dc3739d8c8a168c Mon Sep 17 00:00:00 2001 From: Fabio Tesser Date: Thu, 16 Dec 2021 12:57:14 +0100 Subject: [PATCH 08/13] Skip test that need pytest-order. --- tests/test_05_collect_dependencies.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_05_collect_dependencies.py b/tests/test_05_collect_dependencies.py index faa5801..f422ba0 100644 --- a/tests/test_05_collect_dependencies.py +++ b/tests/test_05_collect_dependencies.py @@ -429,6 +429,7 @@ def test_h(): """) +@pytest.mark.skip(reason="This test requires the pytest-order package") def test_scope_session_collect_dependencies_true_single_test_run_4b(ctestdir): """Two modules, some cross module dependencies in session scope. """ From c9de78b7228f7b430cb08773bf7fee91ee600dbf Mon Sep 17 00:00:00 2001 From: ftesser Date: Mon, 17 Apr 2023 18:02:32 +0200 Subject: [PATCH 09/13] Update setup.py to fix "WARNING: Built wheel for pytest-dependency is invalid: Metadata 1.2 mandates PEP 440 version, but 'UNKNOWN' is not --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 46c02e6..0af44cd 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ version = f.read() except (OSError, IOError): distutils.log.warn("warning: cannot determine version number") - version = "UNKNOWN" + version = "0.5.1-20212102-ftesser-collect_dependencies-20211216" doc_string = __doc__ From 4a65c9a6cf29f8114db9d811334c57794678d439 Mon Sep 17 00:00:00 2001 From: ftesser Date: Mon, 17 Apr 2023 18:08:39 +0200 Subject: [PATCH 10/13] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0af44cd..9c2941e 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ version = f.read() except (OSError, IOError): distutils.log.warn("warning: cannot determine version number") - version = "0.5.1-20212102-ftesser-collect_dependencies-20211216" + version = "0.5.1.20212102-ftesser-collect_dependencies-20211216" doc_string = __doc__ From 06320d3c76411ca96314c5da03d449f8f5a91198 Mon Sep 17 00:00:00 2001 From: ftesser Date: Mon, 17 Apr 2023 18:10:09 +0200 Subject: [PATCH 11/13] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9c2941e..f21b658 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ version = f.read() except (OSError, IOError): distutils.log.warn("warning: cannot determine version number") - version = "0.5.1.20212102-ftesser-collect_dependencies-20211216" + version = "0.5.1.post10" # 20212102-ftesser-collect_dependencies-20211216" doc_string = __doc__ From c4b800c10189959211a8ede870d3949a5d509fff Mon Sep 17 00:00:00 2001 From: ftesser Date: Mon, 17 Apr 2023 18:11:05 +0200 Subject: [PATCH 12/13] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f21b658..27ab2c9 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ version = f.read() except (OSError, IOError): distutils.log.warn("warning: cannot determine version number") - version = "0.5.1.post10" # 20212102-ftesser-collect_dependencies-20211216" + version = "0.5.1.post20212102-ftesser-collect_dependencies-20211216" doc_string = __doc__ From b58d2618ae9eca444fbd151561e05c240de1a891 Mon Sep 17 00:00:00 2001 From: ftesser Date: Mon, 17 Apr 2023 18:13:45 +0200 Subject: [PATCH 13/13] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 27ab2c9..1ff05a6 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ version = f.read() except (OSError, IOError): distutils.log.warn("warning: cannot determine version number") - version = "0.5.1.post20212102-ftesser-collect_dependencies-20211216" + version = "0.5.1.post20212102+ftesser-collect_dependencies-20211216" doc_string = __doc__