pytestomatio 2.8.2.dev41__tar.gz → 2.8.2.dev43__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. {pytestomatio-2.8.2.dev41/pytestomatio.egg-info → pytestomatio-2.8.2.dev43}/PKG-INFO +10 -10
  2. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/README.md +3 -3
  3. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pyproject.toml +21 -20
  4. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/main.py +5 -4
  5. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/testing/testItem.py +20 -10
  6. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/testomatio/filter_plugin.py +14 -6
  7. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43/pytestomatio.egg-info}/PKG-INFO +10 -10
  8. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio.egg-info/SOURCES.txt +2 -2
  9. pytestomatio-2.8.2.dev43/pytestomatio.egg-info/requires.txt +7 -0
  10. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/test_cli_param_test_id.py +1 -1
  11. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/test_cli_params.py +0 -1
  12. pytestomatio-2.8.2.dev43/tests/test_parameters.py +36 -0
  13. pytestomatio-2.8.2.dev41/tests/test_xdist.py → pytestomatio-2.8.2.dev43/tests/test_sync.py +1 -5
  14. pytestomatio-2.8.2.dev41/pytestomatio.egg-info/entry_points.txt +0 -2
  15. pytestomatio-2.8.2.dev41/pytestomatio.egg-info/requires.txt +0 -6
  16. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/LICENSE +0 -0
  17. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/__init__.py +0 -0
  18. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/connect/__init__.py +0 -0
  19. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/connect/connector.py +0 -0
  20. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/connect/s3_connector.py +0 -0
  21. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/decor/__init__.py +0 -0
  22. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/decor/decorator_updater.py +0 -0
  23. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/decor/default.py +0 -0
  24. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/decor/pep8.py +0 -0
  25. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/testing/__init__.py +0 -0
  26. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/testing/code_collector.py +0 -0
  27. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/testomatio/__init__.py +0 -0
  28. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/testomatio/testRunConfig.py +0 -0
  29. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/testomatio/testomat_item.py +0 -0
  30. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/testomatio/testomatio.py +0 -0
  31. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/utils/__init__.py +0 -0
  32. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/utils/helper.py +0 -0
  33. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/utils/parser_setup.py +0 -0
  34. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio/utils/validations.py +0 -0
  35. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio.egg-info/dependency_links.txt +0 -0
  36. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/pytestomatio.egg-info/top_level.txt +0 -0
  37. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/setup.cfg +0 -0
  38. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/sub/__init__.py +0 -0
  39. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/sub/sub_mob/__init__.py +0 -0
  40. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/sub/sub_mob/sub_sub_class_test.py +0 -0
  41. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/sub/sub_mob/sub_sub_test.py +0 -0
  42. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/sub/test_class_sub.py +0 -0
  43. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/sub/test_sub.py +0 -0
  44. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/test_class_root.py +0 -0
  45. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/test_decorators.py +0 -0
  46. {pytestomatio-2.8.2.dev41 → pytestomatio-2.8.2.dev43}/tests/test_root.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytestomatio
3
- Version: 2.8.2.dev41
3
+ Version: 2.8.2.dev43
4
4
  Summary: Pytest plugin to sync test with testomat.io
5
5
  Author: Oleksii Ostapov, TikoQA
6
6
  Project-URL: Testomat.io, https://testomat.io/
@@ -13,12 +13,12 @@ Classifier: Operating System :: OS Independent
13
13
  Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: requests>=2.29.0
17
- Requires-Dist: pytest>7.2.0
18
- Requires-Dist: boto3>=1.28.28
19
- Requires-Dist: libcst==1.1.0
20
- Requires-Dist: commitizen>=3.18.1
21
- Requires-Dist: autopep8>=2.1.0
16
+ Provides-Extra: dev
17
+ Requires-Dist: pytest>=7.2.0; extra == "dev"
18
+ Requires-Dist: pytest-testdox>=2.0.0; extra == "dev"
19
+ Requires-Dist: pytest-xdist==3.6.1; extra == "dev"
20
+ Requires-Dist: python-dotenv==1.0.1; extra == "dev"
21
+ Requires-Dist: toml==0.10.2; extra == "dev"
22
22
 
23
23
  [![Support Ukraine Badge](https://bit.ly/support-ukraine-now)](https://github.com/support-ukraine/support-ukraine)
24
24
 
@@ -226,9 +226,9 @@ def test_example():
226
226
  ## Contribution
227
227
  Use python 3.12
228
228
 
229
- 1. `pip install ".[dev]"` (note, there are still issues with imports in edit mode `pip install -e ".[dev]"`)
230
- 1. `TESTOMATIO_URL=https://beta.testomat.io TESTOMATIO=$TT pytest -p pytester -m smoke`
231
- 1. Test things manually (automated test are WIP)
229
+ 1. `pip install -e ".[dev]"`
230
+ 1. `python ./smoke.py`
231
+ 1. Test things manually
232
232
  1. Verify no regression bugs
233
233
  1. `cz commit`
234
234
  1. `cz bump`
@@ -204,9 +204,9 @@ def test_example():
204
204
  ## Contribution
205
205
  Use python 3.12
206
206
 
207
- 1. `pip install ".[dev]"` (note, there are still issues with imports in edit mode `pip install -e ".[dev]"`)
208
- 1. `TESTOMATIO_URL=https://beta.testomat.io TESTOMATIO=$TT pytest -p pytester -m smoke`
209
- 1. Test things manually (automated test are WIP)
207
+ 1. `pip install -e ".[dev]"`
208
+ 1. `python ./smoke.py`
209
+ 1. Test things manually
210
210
  1. Verify no regression bugs
211
211
  1. `cz commit`
212
212
  1. `cz bump`
@@ -11,9 +11,6 @@ tag_format = "$version"
11
11
  version_scheme = "pep440"
12
12
  version_provider = "pep621"
13
13
  update_changelog_on_bump = false
14
- [project]
15
- name = "pytestomatio"
16
- version = "2.8.2.dev41"
17
14
 
18
15
  dependencies = [
19
16
  "requests>=2.29.0",
@@ -24,11 +21,31 @@ dependencies = [
24
21
  "autopep8>=2.1.0"
25
22
  ]
26
23
 
24
+ [project.optional-dependencies]
25
+ dev = [
26
+ "pytest>=7.2.0",
27
+ "pytest-testdox>=2.0.0",
28
+ "pytest-xdist==3.6.1",
29
+ "python-dotenv==1.0.1",
30
+ "toml==0.10.2"
31
+ ]
32
+
33
+ [tool.pytest.ini_options]
34
+ minversion = "6.0"
35
+ addopts = "-ra -q"
36
+ testpaths = ["tests"]
37
+ markers = [
38
+ "smoke: Run smoke tests",
39
+ ]
40
+
41
+ [project]
42
+ version = "2.8.2.dev43"
43
+ name = "pytestomatio"
44
+ description = "Pytest plugin to sync test with testomat.io"
27
45
  authors = [
28
46
  { name = "Oleksii Ostapov" },
29
47
  { name = "TikoQA" },
30
48
  ]
31
- description = "Pytest plugin to sync test with testomat.io"
32
49
  readme = "README.md"
33
50
  requires-python = ">=3.10"
34
51
  classifiers = [
@@ -42,19 +59,3 @@ classifiers = [
42
59
  "Testomat.io" = "https://testomat.io/"
43
60
  "Homepage" = "https://github.com/testomatio/pytestomatio"
44
61
  "Bug Tracker" = "https://github.com/testomatio/pytestomatio/issues"
45
-
46
- [project.entry-points.pytest11]
47
- pytestomatio = "pytestomatio.main"
48
-
49
- [options.extras_require]
50
- dev = [
51
- "pytest>=7.2.0",
52
- "pytest-testdox>=2.0.0",
53
- "pytest-xdist==3.6.1"
54
- ]
55
-
56
- [tool.pytest.ini_options]
57
- testpaths = ["tests"]
58
- markers = [
59
- "smoke: indicates smoke tests"
60
- ]
@@ -14,6 +14,8 @@ from pytestomatio.testomatio.testRunConfig import TestRunConfig
14
14
  from pytestomatio.testomatio.testomatio import Testomatio
15
15
  from pytestomatio.testomatio.filter_plugin import TestomatioFilterPlugin
16
16
 
17
+ import pdb
18
+
17
19
  log = logging.getLogger(__name__)
18
20
  log.setLevel('INFO')
19
21
 
@@ -43,9 +45,7 @@ def pytest_configure(config: Config):
43
45
  if option == 'debug':
44
46
  return
45
47
 
46
- is_parallel = hasattr(config.option, 'numprocesses')
47
-
48
- pytest.testomatio = Testomatio(TestRunConfig(is_parallel))
48
+ pytest.testomatio = Testomatio(TestRunConfig())
49
49
 
50
50
  url = os.environ.get('TESTOMATIO_URL') or config.getini('testomatio_url') or TESTOMATIO_URL
51
51
  project = os.environ.get('TESTOMATIO')
@@ -164,6 +164,7 @@ def pytest_runtest_makereport(item: Item, call: CallInfo):
164
164
  'code': None,
165
165
  }
166
166
 
167
+ # TODO: refactor it and use TestItem setter to upate those attributes
167
168
  if call.when in ['setup', 'call']:
168
169
  if call.excinfo is not None:
169
170
  if call.excinfo.typename == 'Skipped':
@@ -177,7 +178,7 @@ def pytest_runtest_makereport(item: Item, call: CallInfo):
177
178
  request['status'] = 'passed' if call.when == 'call' else request['status']
178
179
 
179
180
  if hasattr(item, 'callspec'):
180
- request['example'] = item.callspec.params
181
+ request['example'] = test_item.safe_params(item.callspec.params)
181
182
 
182
183
  if item.nodeid not in pytest.testomatio.test_run_config.status_request:
183
184
  pytest.testomatio.test_run_config.status_request[item.nodeid] = request
@@ -124,21 +124,31 @@ class TestItem:
124
124
  return test_name
125
125
  if not item.callspec:
126
126
  return test_name
127
-
127
+
128
128
  pattern = r'\$\{(.*?)\}'
129
129
 
130
130
  def repl(match):
131
131
  key = match.group(1)
132
-
133
132
  value = item.callspec.params.get(key, '')
134
- if type(value) is bytes:
135
- string_value = value.decode('utf-8')
136
- elif isinstance(value, (str, int, float, bool)):
137
- string_value = str(value)
138
- else:
139
- string_value = 'Unsupported type'
133
+
134
+ string_value = self._to_string_value(value)
140
135
  # TODO: handle "value with space" on testomatio BE https://github.com/testomatio/check-tests/issues/147
141
- return sub(r"[\.\s]", "_", string_value) # Temporary fix for spaces in parameter values
136
+ return sub(r"[\.\s]", "_", string_value) # Temporary fix for spaces in parameter values
142
137
 
143
138
  test_name = sub(pattern, repl, sync_title)
144
- return test_name
139
+ return test_name
140
+
141
+ def _to_string_value(self, value):
142
+ if callable(value):
143
+ return value.__name__ if hasattr(value, "__name__") else "anonymous_function"
144
+ elif isinstance(value, bytes):
145
+ return value.decode('utf-8')
146
+ elif isinstance(value, (str, int, float, bool)) or value is None:
147
+ return str(value)
148
+ else:
149
+ return str(value) # Fallback to a string representation
150
+
151
+ # TODO: leverage as an attribute setter
152
+ def safe_params(self, params):
153
+ return {key: self._to_string_value(value) for key, value in params.items()}
154
+
@@ -5,7 +5,6 @@ class TestomatioFilterPlugin:
5
5
  def pytest_collection_modifyitems(self, session, config, items):
6
6
  # By now all other filters (like -m, -k, name-based) have been applied
7
7
  # and `items` is the filtered set after all their conditions.
8
-
9
8
  test_ids_str = config.getoption("test_id")
10
9
  if not test_ids_str:
11
10
  # No custom IDs specified, nothing to do
@@ -31,8 +30,9 @@ class TestomatioFilterPlugin:
31
30
  testomatio_matched.append(item)
32
31
  break
33
32
 
34
- # We'll check common filters: -k, -m and a few others.
33
+ # We'll check common filters: -k, -m and a few others.
35
34
  # If they are empty or None, they are not active.
35
+
36
36
  other_filters_active = bool(
37
37
  config.option.keyword or # -k
38
38
  config.option.markexpr or # -m
@@ -42,12 +42,20 @@ class TestomatioFilterPlugin:
42
42
  False
43
43
  )
44
44
 
45
+ if other_filters_active and "not" in config.option.keyword:
46
+ # If a "not" keyword filter exist - it means we have exclusion filter applied.
47
+ # In such scenario we respect the exclusion filters in a way
48
+ # that we accept tests with requested test ids as long as such tests do not fall into exclusion filter
49
+ items[:] = [item for item in testomatio_matched if item in items]
50
+ return
51
+
45
52
  if other_filters_active:
46
53
  # If other filters are applied, use OR logic:
47
54
  # the final set is all items that passed previous filters plus those matched by test-ids
48
55
  # preserving original order of test
49
56
  items[:] = items + [item for item in testomatio_matched if item not in items]
50
- else:
51
- # If no other filters are applied, test-ids filter acts as an exclusive filter:
52
- # only run tests that match the given test IDs
53
- items[:] = testomatio_matched
57
+ return
58
+
59
+ # If no other filters are applied, test-ids filter acts as an exclusive filter:
60
+ # only run tests that match the given test IDs
61
+ items[:] = testomatio_matched
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pytestomatio
3
- Version: 2.8.2.dev41
3
+ Version: 2.8.2.dev43
4
4
  Summary: Pytest plugin to sync test with testomat.io
5
5
  Author: Oleksii Ostapov, TikoQA
6
6
  Project-URL: Testomat.io, https://testomat.io/
@@ -13,12 +13,12 @@ Classifier: Operating System :: OS Independent
13
13
  Requires-Python: >=3.10
14
14
  Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
- Requires-Dist: requests>=2.29.0
17
- Requires-Dist: pytest>7.2.0
18
- Requires-Dist: boto3>=1.28.28
19
- Requires-Dist: libcst==1.1.0
20
- Requires-Dist: commitizen>=3.18.1
21
- Requires-Dist: autopep8>=2.1.0
16
+ Provides-Extra: dev
17
+ Requires-Dist: pytest>=7.2.0; extra == "dev"
18
+ Requires-Dist: pytest-testdox>=2.0.0; extra == "dev"
19
+ Requires-Dist: pytest-xdist==3.6.1; extra == "dev"
20
+ Requires-Dist: python-dotenv==1.0.1; extra == "dev"
21
+ Requires-Dist: toml==0.10.2; extra == "dev"
22
22
 
23
23
  [![Support Ukraine Badge](https://bit.ly/support-ukraine-now)](https://github.com/support-ukraine/support-ukraine)
24
24
 
@@ -226,9 +226,9 @@ def test_example():
226
226
  ## Contribution
227
227
  Use python 3.12
228
228
 
229
- 1. `pip install ".[dev]"` (note, there are still issues with imports in edit mode `pip install -e ".[dev]"`)
230
- 1. `TESTOMATIO_URL=https://beta.testomat.io TESTOMATIO=$TT pytest -p pytester -m smoke`
231
- 1. Test things manually (automated test are WIP)
229
+ 1. `pip install -e ".[dev]"`
230
+ 1. `python ./smoke.py`
231
+ 1. Test things manually
232
232
  1. Verify no regression bugs
233
233
  1. `cz commit`
234
234
  1. `cz bump`
@@ -6,7 +6,6 @@ pytestomatio/main.py
6
6
  pytestomatio.egg-info/PKG-INFO
7
7
  pytestomatio.egg-info/SOURCES.txt
8
8
  pytestomatio.egg-info/dependency_links.txt
9
- pytestomatio.egg-info/entry_points.txt
10
9
  pytestomatio.egg-info/requires.txt
11
10
  pytestomatio.egg-info/top_level.txt
12
11
  pytestomatio/connect/__init__.py
@@ -32,8 +31,9 @@ tests/test_class_root.py
32
31
  tests/test_cli_param_test_id.py
33
32
  tests/test_cli_params.py
34
33
  tests/test_decorators.py
34
+ tests/test_parameters.py
35
35
  tests/test_root.py
36
- tests/test_xdist.py
36
+ tests/test_sync.py
37
37
  tests/sub/__init__.py
38
38
  tests/sub/test_class_sub.py
39
39
  tests/sub/test_sub.py
@@ -0,0 +1,7 @@
1
+
2
+ [dev]
3
+ pytest>=7.2.0
4
+ pytest-testdox>=2.0.0
5
+ pytest-xdist==3.6.1
6
+ python-dotenv==1.0.1
7
+ toml==0.10.2
@@ -57,8 +57,8 @@ def test_cli_param_test_id_without_k_filter_matching_2_tests(pytester):
57
57
  # The testomatio and test-id parameters are lost in the pytester env.
58
58
  # Please test it in a semiautomated way with "test_cli_params.py" test
59
59
  @pytest.mark.testomatio("@T5a965adf")
60
- @pytest.mark.skip
61
60
  def test_cli_param_test_id_with_test_id_filter(pytester):
61
+ pytest.skip()
62
62
  pytester.makepyfile(test_file)
63
63
 
64
64
  result = pytester.runpytest_inprocess("--testomatio", "report", '--test-id="@T123"', "-vv")
@@ -7,7 +7,6 @@
7
7
  # ======================================= 3 passed, 50 deselected in 0.89s =======================================
8
8
 
9
9
  import pytest
10
- pytestmark = pytest.mark.smoke
11
10
 
12
11
  @pytest.mark.testomatio("@T55ecbca9")
13
12
  def test_smoke():
@@ -0,0 +1,36 @@
1
+ import pytest
2
+ pytestmark = pytest.mark.smoke
3
+
4
+ test_file = """
5
+ import pytest
6
+
7
+ # Define some dummy callables
8
+ def add(a, b):
9
+ return a + b
10
+
11
+ def multiply(a, b):
12
+ return a * b
13
+
14
+ @pytest.mark.testomatio("@Tbca18714")
15
+ @pytest.mark.parametrize(
16
+ "operation, a, b, expected",
17
+ [
18
+ (add, 2, 3, 5), # Test add function
19
+ (multiply, 2, 3, 6), # Test multiply function
20
+ ],
21
+ )
22
+ def test_operations(operation, a, b, expected):
23
+ # Call the provided operation
24
+ result = operation(a, b)
25
+ assert result == expected, f"Expected {expected}, got {result}"
26
+ """
27
+
28
+ @pytest.mark.testomatio("@Tb8930394")
29
+ def test_callable_in_params(pytester):
30
+ pytester.makepyfile(test_file)
31
+
32
+ result = pytester.runpytest("--testomatio", "report", "-vv")
33
+ result.assert_outcomes(passed=2, failed=0, skipped=0)
34
+ assert "test_callable_in_params.py::test_operations[add-2-3-5] PASSED" in result.stdout.str()
35
+ assert "test_callable_in_params.py::test_operations[multiply-2-3-6] PASSED" in result.stdout.str()
36
+
@@ -1,4 +1,5 @@
1
1
  import pytest
2
+ #TODO verify requests to testomatio
2
3
 
3
4
  @pytest.mark.testomatio("@Tfaf4da53")
4
5
  @pytest.mark.smoke
@@ -37,10 +38,5 @@ def test_sync_works_with_xdist_set_to_0(pytester):
37
38
  "*Sync completed without test execution*"
38
39
  ])
39
40
 
40
- # Assert that no tests were run
41
- result.stdout.fnmatch_lines([
42
- "*no tests ran in *"
43
- ])
44
-
45
41
  # Optional: Verify the process exited successfully (0 means no error)
46
42
  assert result.ret == 2
@@ -1,2 +0,0 @@
1
- [pytest11]
2
- pytestomatio = pytestomatio.main
@@ -1,6 +0,0 @@
1
- requests>=2.29.0
2
- pytest>7.2.0
3
- boto3>=1.28.28
4
- libcst==1.1.0
5
- commitizen>=3.18.1
6
- autopep8>=2.1.0