Compare commits

...

15 Commits

Author SHA256 Message Date
Ana Guerrero
a6dd35100c Accepting request 1226226 from devel:languages:python:pytest
- update to 4.0.0:
  * v.4.0.0
  * Drop support for Python 2.7, 3.5, 3.6, 3.7
  * Added support for Python 3.11, 3.12
  * Migrate project back to pip from poetry
  * Replace mock by version from stdlib
- drop python-pytest-spec-nopython2.patch: upstream

OBS-URL: https://build.opensuse.org/request/show/1226226
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-spec?expand=0&rev=7
2024-11-25 22:22:32 +00:00
Ana Guerrero
438435b6a7 Accepting request 1111343 from devel:languages:python:pytest
- drop python2 support completely, python-six not required
- deleted patches
  - remove-mock.patch (upstreamed)
- added patches
  fix https://github.com/pchomik/pytest-spec/compare/3.2.0...master
  + python-pytest-spec-nopython2.patch

OBS-URL: https://build.opensuse.org/request/show/1111343
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-spec?expand=0&rev=6
2023-09-15 20:04:32 +00:00
d776ce18cc drop the patch for real
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-spec?expand=0&rev=13
2023-09-14 13:00:37 +00:00
44fbcea22d Accepting request 1111329 from home:pgajdos:python
- drop python2 support completely, python-six not required
- deleted patches
  - remove-mock.patch (upstreamed)
- added patches
  fix https://github.com/pchomik/pytest-spec/compare/3.2.0...master
  + python-pytest-spec-nopython2.patch

OBS-URL: https://build.opensuse.org/request/show/1111329
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-spec?expand=0&rev=12
2023-09-14 12:59:26 +00:00
Dominique Leuenberger
5c49e84d5a Accepting request 964440 from devel:languages:python:pytest
- Update to 3.2.0:
  * Added support for multiline docstrings
  * Added logic to use docstring_summary instead of test name
  * Added logic to ignore some tests from spec output
  * Changed indicator for skipped tests
  * Improve formatting for functions
  * Changed actions to test against python and pytest versions
  * Added tests to sdist
- Add patch remove-mock.patch:
  * Use stdlib unittest.mock
- Correct filelist, and do not install test directory under sitelib.
- Remove mock from {Build,}Requires, add six.
- Drop seperate LICENSE, it's now included.
- Actually run the testsuite.

OBS-URL: https://build.opensuse.org/request/show/964440
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-spec?expand=0&rev=5
2022-03-24 21:58:11 +00:00
Steve Kowalik
d48b71a66a - Update to 3.2.0:
* Added support for multiline docstrings
  * Added logic to use docstring_summary instead of test name
  * Added logic to ignore some tests from spec output
  * Changed indicator for skipped tests
  * Improve formatting for functions
  * Changed actions to test against python and pytest versions
  * Added tests to sdist
- Add patch remove-mock.patch:
  * Use stdlib unittest.mock
- Correct filelist, and do not install test directory under sitelib.
- Remove mock from {Build,}Requires, add six.
- Drop seperate LICENSE, it's now included.
- Actually run the testsuite.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-spec?expand=0&rev=10
2022-03-24 01:29:51 +00:00
Dominique Leuenberger
1a113c1856 Accepting request 846348 from devel:languages:python:pytest
OBS-URL: https://build.opensuse.org/request/show/846348
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-spec?expand=0&rev=4
2020-11-06 22:44:55 +00:00
94851941e0 Accepting request 846276 from home:mmachova:branches:devel:languages:python:pytest
- Update to 3.0.5
  * Fixed SyntaxWarning issue
  * Fixed output format for pytest-describe
  * Active plugin only if -q or -v was not provided
  * Fixed Python 2/3 warnings
  * Added support for Python 3.9

OBS-URL: https://build.opensuse.org/request/show/846276
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-spec?expand=0&rev=8
2020-11-05 21:35:41 +00:00
Dominique Leuenberger
92c250fb56 Accepting request 757721 from devel:languages:python:pytest
OBS-URL: https://build.opensuse.org/request/show/757721
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-spec?expand=0&rev=3
2019-12-18 13:47:07 +00:00
5c2c3a922f Accepting request 757653 from home:jayvdb:branches:devel:languages:python:pytest
- Dropped no longer necessary pytest4.patch
- Update to v2.0.0
  * Update documentation
  * New format of output
  * Fix small warnings
  * Generate the package in wheel format

OBS-URL: https://build.opensuse.org/request/show/757653
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-spec?expand=0&rev=6
2019-12-18 10:57:16 +00:00
Dominique Leuenberger
7693845dfb Accepting request 725257 from devel:languages:python:pytest
- Add patches to work with new pytest:
  * pytest4.patch

OBS-URL: https://build.opensuse.org/request/show/725257
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-spec?expand=0&rev=2
2019-08-22 13:05:47 +00:00
Tomáš Chvátal
b544588926 - Add patches to work with new pytest:
* pytest4.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-spec?expand=0&rev=4
2019-08-22 09:01:39 +00:00
Dominique Leuenberger
39af746861 Accepting request 687179 from devel:languages:python:pytest
- Use noun phrase in summary.
- Initial spec for v1.1.0

OBS-URL: https://build.opensuse.org/request/show/687179
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pytest-spec?expand=0&rev=1
2019-03-22 14:08:22 +00:00
Tomáš Chvátal
6ec11d0c2f Accepting request 687177 from home:jengelh:branches:devel:languages:python:pytest
- Use noun phrase in summary.

OBS-URL: https://build.opensuse.org/request/show/687177
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-spec?expand=0&rev=2
2019-03-21 10:10:58 +00:00
Tomáš Chvátal
80160cd30d Accepting request 687152 from home:jayvdb:coala:test-rig
- Initial spec for v1.1.0

OBS-URL: https://build.opensuse.org/request/show/687152
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-spec?expand=0&rev=1
2019-03-21 09:49:16 +00:00
2 changed files with 0 additions and 381 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4af154588195f4bb6c62d6ca030a20218db7d80b675a08897d9a99239ea3d087
size 16980

View File

@ -1,378 +0,0 @@
diff --git a/README.md b/README.md
index b6dcf76..c1c8004 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,6 @@
<p>
<h1 align="center">pytest-spec</h1>
<p align="center">
- <img src="https://badgen.net/badge/python/2.7/green">
<img src="https://badgen.net/badge/python/3.5/green">
<img src="https://badgen.net/badge/python/3.6/green">
<img src="https://badgen.net/badge/python/3.7/green">
@@ -45,9 +44,15 @@
### spec_header_format
-You can configure the format of the test headers by specifying a [format string](https://docs.python.org/2/library/string.html#format-string-syntax) in your [ini-file](http://doc.pytest.org/en/latest/customize.html#inifiles):
+You can configure the format of the test headers by specifying a [format string](https://docs.python.org/2/library/string.html#format-string-syntax) in your [ini-file](https://docs.pytest.org/en/stable/customize.html#pytest-ini):
+
```ini
+ ; since pytest 4.6.x
+ [pytest]
+ spec_header_format = {module_path}:
+
+ ; legacy pytest
[tool:pytest]
spec_header_format = {module_path}:
```
@@ -56,7 +61,7 @@ In addition to the ``{path}`` and ``{class_name}`` replacement fields, there is
### spec_test_format
-You can configure the format of the test results by specifying a [format string](https://docs.python.org/2/library/string.html#format-string-syntax) in your [ini-file](http://doc.pytest.org/en/latest/customize.html#inifiles):
+You can configure the format of the test results by specifying a [format string](https://docs.python.org/2/library/string.html#format-string-syntax) in your [ini-file](https://docs.pytest.org/en/stable/customize.html#pytest-ini):
3 variables are available:
* result - place for indicator
@@ -64,6 +69,11 @@ You can configure the format of the test results by specifying a [format string]
* docstring_summary - first line from test docstring if available
```ini
+ ; since pytest 4.6.x
+ [pytest]
+ spec_test_format = {result} {name}
+
+ ; legacy pytest
[tool:pytest]
spec_test_format = {result} {name}
```
@@ -71,6 +81,11 @@ You can configure the format of the test results by specifying a [format string]
or
```ini
+ ; since pytest 4.6.x
+ [pytest]
+ spec_test_format = {result} {docstring_summary}
+
+ ; legacy pytest
[tool:pytest]
spec_test_format = {result} {docstring_summary}
```
@@ -82,6 +97,11 @@ In second example where docstring is not available the name will be added to spe
You can configure the indicator displayed when test passed.
```ini
+ ; since pytest 4.6.x
+ [pytest]
+ spec_success_indicator = ✓
+
+ ; legacy pytest
[tool:pytest]
spec_success_indicator = ✓
```
@@ -91,6 +111,11 @@ You can configure the indicator displayed when test passed.
You can configure the indicator displated when test failed.
```ini
+ ; since pytest 4.6.x
+ [pytest]
+ spec_failure_indicator = ✗
+
+ ; legacy pytest
[tool:pytest]
spec_failure_indicator = ✗
```
@@ -100,6 +125,11 @@ You can configure the indicator displated when test failed.
You can configure the indicator displated when test is skipped.
```ini
+ ; since pytest 4.6.x
+ [pytest]
+ spec_skipped_indicator = ?
+
+ ; legacy pytest
[tool:pytest]
spec_skipped_indicator = ?
```
@@ -110,6 +140,11 @@ Comma-separated settings to ignore/hide some tests or output from from plugins l
Any test which contain provided string will be ignored in output spec.
```ini
+ ; since pytest 4.6.x
+ [pytest]
+ spec_ignore = FLAKE8
+
+ ; legacy pytest
[tool:pytest]
spec_ignore = FLAKE8
```
@@ -117,6 +152,11 @@ Any test which contain provided string will be ignored in output spec.
### spec_indent
```ini
+ ; since pytest 4.6.x
+ [pytest]
+ spec_indent = " "
+
+ ; legacy pytest
[tool:pytest]
spec_indent = " "
```
diff --git a/pyproject.toml b/pyproject.toml
index ca689f9..08ebe3e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -12,8 +12,8 @@ classifiers = [
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
- "Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
@@ -30,10 +30,9 @@ packages = [
include = ["LICENSE.txt"]
[tool.poetry.dependencies]
-six = "*"
+python = ">=3.5"
[tool.poetry.dev-dependencies]
-mock = ">1.0.1"
pytest = "*"
pytest-describe = "*"
pytest-flake8 = "*"
diff --git a/pytest_spec/__init__.py b/pytest_spec/__init__.py
index 55ea5f7..141763d 100644
--- a/pytest_spec/__init__.py
+++ b/pytest_spec/__init__.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
:author: Pawel Chomicki
"""
diff --git a/pytest_spec/patch.py b/pytest_spec/patch.py
index 2110e82..a39ccce 100644
--- a/pytest_spec/patch.py
+++ b/pytest_spec/patch.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""Module contains method that will be replaced by the plugin.
:author: Pawel Chomicki
@@ -183,7 +182,7 @@ def _get_test_name(nodeid):
test_name_parts = test_name.split(' ')
if len(test_name_parts) == 1:
return test_name.strip().capitalize()
- return 'The ({0}) {1}'.format(test_name_parts[0][1:].replace(' ', '_'), test_name_parts[1])
+ return 'The ({}) {}'.format(test_name_parts[0][1:].replace(' ', '_'), test_name_parts[1])
return test_name
diff --git a/pytest_spec/plugin.py b/pytest_spec/plugin.py
index 08c76ff..f32e3b3 100644
--- a/pytest_spec/plugin.py
+++ b/pytest_spec/plugin.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""Module contains command line option definition and logic needed to enable new formatting.
:author: Pawel Chomicki
@@ -57,12 +56,12 @@ def pytest_addoption(parser):
def pytest_configure(config):
if getattr(config.option, 'spec', 0) and not getattr(config.option, 'quiet', 0) and not getattr(config.option, 'verbose', 0):
- import six
+ import importlib
import _pytest
_pytest.terminal.TerminalReporter.pytest_runtest_logstart = logstart_replacer
_pytest.terminal.TerminalReporter.pytest_runtest_logreport = report_replacer
_pytest.terminal.TerminalReporter.pytest_collection_modifyitems = modifyitems_replacer
- six.moves.reload_module(_pytest)
+ importlib.reload(_pytest)
@pytest.mark.hookwrapper
diff --git a/pytest_spec/replacer.py b/pytest_spec/replacer.py
index 8d81184..83a6f0a 100644
--- a/pytest_spec/replacer.py
+++ b/pytest_spec/replacer.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""Module contains method for replace operation.
Additional method are necessary because self is not yet defined and module
diff --git a/test/test_formats/test_describe_format.py b/test/test_formats/test_describe_format.py
index 602c9a5..adc1070 100644
--- a/test/test_formats/test_describe_format.py
+++ b/test/test_formats/test_describe_format.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
:author: Pawel Chomicki
:e-mail: pawel.chomicki@gmail.com
diff --git a/test/test_formats/test_functions.py b/test/test_formats/test_functions.py
index 020d401..4763bf9 100644
--- a/test/test_formats/test_functions.py
+++ b/test/test_formats/test_functions.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
:author: Pawel Chomicki
:e-mail: pawel.chomicki@gmail.com
diff --git a/test/test_formats/test_methods.py b/test/test_formats/test_methods.py
index 077e178..09cc005 100644
--- a/test/test_formats/test_methods.py
+++ b/test/test_formats/test_methods.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
:author: Pawel Chomicki
:e-mail: pawel.chomicki@gmail.com
@@ -6,7 +5,7 @@
import unittest
-class SomeClass(object):
+class SomeClass:
def some_method(self, arg):
return arg
diff --git a/test/test_patch.py b/test/test_patch.py
index 05ec407..df7956d 100644
--- a/test/test_patch.py
+++ b/test/test_patch.py
@@ -1,16 +1,15 @@
-# -*- coding: utf-8 -*-
"""
:author: Pawel Chomicki
"""
import unittest
-from mock import Mock, call
+from unittest.mock import Mock, call
import pytest_spec
from pytest_spec.patch import pytest_runtest_logstart, pytest_runtest_logreport
-class FakeHook(object):
+class FakeHook:
def __init__(self, *args, **kwargs):
self.cat = kwargs.get('cat', ' ')
self.letter = kwargs.get('letter', ' ')
@@ -20,7 +19,7 @@ def pytest_report_teststatus(self, report, config):
return self.cat, self.letter, self.word
-class FakeConfig(object):
+class FakeConfig:
def __init__(self, *args, **kwargs):
self.hook = FakeHook(*args, **kwargs)
@@ -43,12 +42,12 @@ def getini(self, option):
return result
-class FakeStats(object):
+class FakeStats:
def setdefault(self, first, second):
return []
-class FakeSelf(object):
+class FakeSelf:
def __init__(self, *args, **kwargs):
self.config = FakeConfig(*args, **kwargs)
self.currentfspath = None
@@ -56,7 +55,7 @@ def __init__(self, *args, **kwargs):
self.stats = FakeStats()
-class FakeReport(object):
+class FakeReport:
def __init__(self, nodeid, *args, **kwargs):
self.nodeid = nodeid
self.passed = kwargs.get('passed', True)
diff --git a/test/test_plugin.py b/test/test_plugin.py
index 2bcaec4..0d27972 100755
--- a/test/test_plugin.py
+++ b/test/test_plugin.py
@@ -1,20 +1,19 @@
-# -*- coding: utf-8 -*-
"""
:author: Pawel Chomicki
"""
import unittest
-from mock import Mock, call, patch
+from unittest.mock import Mock, call, patch
from pytest_spec.plugin import pytest_addoption, pytest_configure
-class FakeOption(object):
+class FakeOption:
def __init__(self, spec=False):
self.spec = spec
self.verbose = 0
-class FakeConfig(object):
+class FakeConfig:
def __init__(self, spec):
self.option = FakeOption(spec=spec)
@@ -34,12 +33,12 @@ def test__pytest_adoption__adds_spec_option(self):
dest='spec',
help='Print test result in specification format')])
- @patch('six.moves.reload_module')
+ @patch('importlib.reload')
def test__pytest_configure__should_not_reload_configuration(self, imp_mock):
pytest_configure(FakeConfig(spec=False))
self.assertEqual(len(imp_mock.mock_calls), 0)
- @patch('six.moves.reload_module')
+ @patch('importlib.reload')
def test__pytest_configure__reloads_pytest_after_patching(self, imp_mock):
pytest_configure(FakeConfig(spec=True))
self.assertEqual(len(imp_mock.mock_calls), 1)
diff --git a/test/test_replacer.py b/test/test_replacer.py
index 9526bc1..1106cdf 100644
--- a/test/test_replacer.py
+++ b/test/test_replacer.py
@@ -1,10 +1,9 @@
-# -*- coding: utf-8 -*-
"""
:author: Pawel Chomicki
"""
import unittest
-from mock import patch
+from unittest.mock import patch
from pytest_spec.replacer import logstart_replacer, report_replacer
diff --git a/test/test_results/test_as_class.py b/test/test_results/test_as_class.py
index 5445dec..2ffeb60 100644
--- a/test/test_results/test_as_class.py
+++ b/test/test_results/test_as_class.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
:author: Pawel Chomicki
:e-mail: pawel.chomicki@gmail.com
diff --git a/test/test_results/test_as_functions.py b/test/test_results/test_as_functions.py
index f725e61..5154531 100644
--- a/test/test_results/test_as_functions.py
+++ b/test/test_results/test_as_functions.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""
:author: Pawel Chomicki
:e-mail: pawel.chomicki@gmail.com