summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2019-07-14 16:04:52 +0100
committerSean Whitton <spwhitton@spwhitton.name>2019-07-14 16:04:52 +0100
commit2cedfbef17bdc2e5169a1c8b209125214ef70c54 (patch)
tree8392d3cc5e23e8a2621a21cd7b9f51e3a9d23ace
parent35e850cd7942b8c14f136ea34bbd05fb7393301f (diff)
parentb16cbce98f53d65b1bc1e3f6684741d4bee2992b (diff)
Update upstream source from tag 'upstream/2019.1.8'
Update to upstream version '2019.1.8' with Debian dir 5c8b4c71dd56862b2be2674c4601b2e3a2dab7cb
-rw-r--r--PKG-INFO31
-rw-r--r--README.rst21
-rw-r--r--pytest_helpers_namespace.egg-info/PKG-INFO31
-rw-r--r--pytest_helpers_namespace/plugin.py35
-rw-r--r--pytest_helpers_namespace/version.py4
-rw-r--r--setup.cfg1
-rw-r--r--setup.py8
7 files changed, 108 insertions, 23 deletions
diff --git a/PKG-INFO b/PKG-INFO
index a5a52bb..797de13 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,10 +1,12 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: pytest-helpers-namespace
-Version: 2017.11.11
+Version: 2019.1.8
Summary: PyTest Helpers Namespace
Home-page: https://github.com/saltstack/pytest-helpers-namespace
Author: Pedro Algarvio
Author-email: pedro@algarvio.me
+Maintainer: Pedro Algarvio
+Maintainer-email: pedro@algarvio.me
License: Apache Software License 2.0
Description: Pytest Helpers Namespace
========================
@@ -148,6 +150,27 @@ Description: Pytest Helpers Namespace
Changelog
---------
+
+ v2019.1.8
+ ~~~~~~~~~
+
+ * Patch PyTest before any ``conftest.py`` file is processed.
+
+ v2019.1.7
+ ~~~~~~~~~
+
+ * Support PyTest >= 4.1
+
+ v2019.1.6.post1
+ ~~~~~~~~~~~~~~~
+
+ * No changes were made besides locking to PyTest < 4.0
+
+ v2019.1.6
+ ~~~~~~~~~
+
+ * No changes were made besides locking to PyTest < 4.1
+
v2017.11.11
~~~~~~~~~~~
@@ -209,9 +232,9 @@ Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Operating System :: OS Independent
diff --git a/README.rst b/README.rst
index 6b524c9..1b95423 100644
--- a/README.rst
+++ b/README.rst
@@ -140,6 +140,27 @@ description.
Changelog
---------
+
+v2019.1.8
+~~~~~~~~~
+
+* Patch PyTest before any ``conftest.py`` file is processed.
+
+v2019.1.7
+~~~~~~~~~
+
+* Support PyTest >= 4.1
+
+v2019.1.6.post1
+~~~~~~~~~~~~~~~
+
+* No changes were made besides locking to PyTest < 4.0
+
+v2019.1.6
+~~~~~~~~~
+
+* No changes were made besides locking to PyTest < 4.1
+
v2017.11.11
~~~~~~~~~~~
diff --git a/pytest_helpers_namespace.egg-info/PKG-INFO b/pytest_helpers_namespace.egg-info/PKG-INFO
index a5a52bb..797de13 100644
--- a/pytest_helpers_namespace.egg-info/PKG-INFO
+++ b/pytest_helpers_namespace.egg-info/PKG-INFO
@@ -1,10 +1,12 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: pytest-helpers-namespace
-Version: 2017.11.11
+Version: 2019.1.8
Summary: PyTest Helpers Namespace
Home-page: https://github.com/saltstack/pytest-helpers-namespace
Author: Pedro Algarvio
Author-email: pedro@algarvio.me
+Maintainer: Pedro Algarvio
+Maintainer-email: pedro@algarvio.me
License: Apache Software License 2.0
Description: Pytest Helpers Namespace
========================
@@ -148,6 +150,27 @@ Description: Pytest Helpers Namespace
Changelog
---------
+
+ v2019.1.8
+ ~~~~~~~~~
+
+ * Patch PyTest before any ``conftest.py`` file is processed.
+
+ v2019.1.7
+ ~~~~~~~~~
+
+ * Support PyTest >= 4.1
+
+ v2019.1.6.post1
+ ~~~~~~~~~~~~~~~
+
+ * No changes were made besides locking to PyTest < 4.0
+
+ v2019.1.6
+ ~~~~~~~~~
+
+ * No changes were made besides locking to PyTest < 4.1
+
v2017.11.11
~~~~~~~~~~~
@@ -209,9 +232,9 @@ Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Operating System :: OS Independent
diff --git a/pytest_helpers_namespace/plugin.py b/pytest_helpers_namespace/plugin.py
index 95ab3e5..4eb7239 100644
--- a/pytest_helpers_namespace/plugin.py
+++ b/pytest_helpers_namespace/plugin.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
- :copyright: © 2016-2017 by the SaltStack Team, see AUTHORS for more details.
+ :copyright: © 2016-2019 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
@@ -14,6 +14,9 @@
# Import python libs
from functools import partial, wraps
+# Import 3rd-party libs
+import pytest
+
class FuncWrapper(object):
@@ -86,8 +89,28 @@ class HelpersRegistry(object):
)
-def pytest_namespace():
- '''
- Register our own namespace with pytest
- '''
- return {'helpers': HelpersRegistry()}
+if tuple([int(part) for part in pytest.__version__.split('.') if part.isdigit()]) < (4, 1):
+ # PyTest < 4.1
+ def pytest_namespace():
+ '''
+ Register our own namespace with pytest
+ '''
+ return {'helpers': HelpersRegistry()}
+else:
+ # PyTest >= 4.1
+ # This now uses the stop gap provided in:
+ # https://docs.pytest.org/en/latest/deprecations.html#pytest-namespace
+ #
+ # We however use `pytest_load_initial_conftests` because we need to "patch"
+ # pytest before any conftest is loaded.
+ def pytest_load_initial_conftests(early_config, parser, args):
+ try:
+ pytest.helpers
+ except AttributeError:
+ pytest.helpers = HelpersRegistry()
+
+ def pytest_unconfigure():
+ try:
+ delattr(pytest, 'helpers')
+ except AttributeError:
+ pass
diff --git a/pytest_helpers_namespace/version.py b/pytest_helpers_namespace/version.py
index 12bc370..b242d2e 100644
--- a/pytest_helpers_namespace/version.py
+++ b/pytest_helpers_namespace/version.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
- :copyright: © 2016-2017 by the SaltStack Team, see AUTHORS for more details.
+ :copyright: © 2016-2019 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
@@ -16,5 +16,5 @@
from __future__ import absolute_import
-__version_info__ = (2017, 11, 11)
+__version_info__ = (2019, 1, 8)
__version__ = '{0}.{1}.{2}'.format(*__version_info__)
diff --git a/setup.cfg b/setup.cfg
index e219d9c..5182a88 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -11,5 +11,4 @@ universal = 1
[egg_info]
tag_build =
tag_date = 0
-tag_svn_revision = 0
diff --git a/setup.py b/setup.py
index 84a02c1..02bacaf 100644
--- a/setup.py
+++ b/setup.py
@@ -45,10 +45,6 @@ with codecs.open(os.path.join(SETUP_DIRNAME,
VERSION = _LOCALS['__version__']
LONG_DESCRIPTION = read('README.rst')
-def read(fname):
- file_path = os.path.join(os.path.dirname(__file__), fname)
- return codecs.open(file_path, encoding='utf-8').read()
-
setup(
name='pytest-helpers-namespace',
@@ -72,9 +68,9 @@ setup(
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.3',
- 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Operating System :: OS Independent',