Hello community,
here is the log from the commit of package python-pytest-dotenv for
openSUSE:Factory checked in at 2020-06-10 00:49:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-dotenv (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-dotenv.new.3606 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-dotenv"
Wed Jun 10 00:49:48 2020 rev:2 rq:812816 version:0.5.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-pytest-dotenv/python-pytest-dotenv.changes
2019-02-25 17:52:50.250657519 +0100
+++
/work/SRC/openSUSE:Factory/.python-pytest-dotenv.new.3606/python-pytest-dotenv.changes
2020-06-10 00:49:50.299168212 +0200
@@ -1,0 +2,8 @@
+Tue Jun 9 08:03:40 UTC 2020 - Tomáš Chvátal <[email protected]>
+
+- Switch to github archive for tests
+- Update to 0.5.1:
+ * Fixes for new pytest
+ * Drop py2 support
+
+-------------------------------------------------------------------
Old:
----
pytest-dotenv-0.4.0.tar.gz
New:
----
0.5.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-dotenv.spec ++++++
--- /var/tmp/diff_new_pack.GlPSeo/_old 2020-06-10 00:49:50.839169625 +0200
+++ /var/tmp/diff_new_pack.GlPSeo/_new 2020-06-10 00:49:50.843169635 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-dotenv
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,18 +17,20 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%define skip_python2 1
Name: python-pytest-dotenv
-Version: 0.4.0
+Version: 0.5.1
Release: 0
Summary: A pytest plugin that parses environment files
License: MIT
-Group: Development/Languages/Python
URL: https://github.com/quiqua/pytest-dotenv
-Source:
https://files.pythonhosted.org/packages/source/p/pytest-dotenv/pytest-dotenv-%{version}.tar.gz
+Source:
https://github.com/quiqua/pytest-dotenv/archive/%{version}.tar.gz
+BuildRequires: %{python_module pytest >= 5.0}
+BuildRequires: %{python_module python-dotenv >= 0.9.1}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires: python-pytest >= 2.6.0
+Requires: python-pytest >= 5.0
Requires: python-python-dotenv >= 0.9.1
BuildArch: noarch
%python_subpackages
@@ -46,6 +48,9 @@
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%check
+%pytest
+
%files %{python_files}
%doc README.md
%license LICENSE
++++++ pytest-dotenv-0.4.0.tar.gz -> 0.5.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/.gitignore
new/pytest-dotenv-0.5.1/.gitignore
--- old/pytest-dotenv-0.4.0/.gitignore 1970-01-01 01:00:00.000000000 +0100
+++ new/pytest-dotenv-0.5.1/.gitignore 2020-06-05 13:25:02.000000000 +0200
@@ -0,0 +1,54 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+env/
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+*.egg-info/
+.installed.cfg
+*.egg
+
+# PyInstaller
+# Usually these files are written by a python script from a template
+# before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.coverage
+.cache
+nosetests.xml
+coverage.xml
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+target/
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/LICENSE
new/pytest-dotenv-0.5.1/LICENSE
--- old/pytest-dotenv-0.4.0/LICENSE 2019-02-21 11:50:46.000000000 +0100
+++ new/pytest-dotenv-0.5.1/LICENSE 2020-06-05 13:25:02.000000000 +0200
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2019 Marcel Radischat
+Copyright (c) 2020 Marcel Radischat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/MANIFEST.in
new/pytest-dotenv-0.5.1/MANIFEST.in
--- old/pytest-dotenv-0.4.0/MANIFEST.in 2019-02-21 11:48:49.000000000 +0100
+++ new/pytest-dotenv-0.5.1/MANIFEST.in 2020-06-05 13:25:02.000000000 +0200
@@ -1,2 +1,5 @@
include LICENSE
include README.md
+
+recursive-exclude * __pycache__
+recursive-exclude * *.py[co]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/PKG-INFO
new/pytest-dotenv-0.5.1/PKG-INFO
--- old/pytest-dotenv-0.4.0/PKG-INFO 2019-02-21 11:54:27.000000000 +0100
+++ new/pytest-dotenv-0.5.1/PKG-INFO 1970-01-01 01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-Metadata-Version: 1.1
-Name: pytest-dotenv
-Version: 0.4.0
-Summary: A py.test plugin that parses environment files before running tests
-Home-page: https://github.com/quiqua/pytest-dotenv
-Author: Marcel Radischat
-Author-email: [email protected]
-License: UNKNOWN
-Download-URL: https://github.com/quiqua/pytest-dotenv/tarball/0.2.0
-Description: A py.test plugin that parses environment files before running
tests
-Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Natural Language :: English
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/README.md
new/pytest-dotenv-0.5.1/README.md
--- old/pytest-dotenv-0.4.0/README.md 2019-02-21 11:31:25.000000000 +0100
+++ new/pytest-dotenv-0.5.1/README.md 2020-06-05 13:25:02.000000000 +0200
@@ -47,3 +47,8 @@
.test.env
.deploy.env
```
+
+### Alternative: Specify the file at the command line
+
+You also have the option to run your tests with `py.test --envfile
path/to/.env`.
+This will load all defined environment variables and overwrite any existing
ones regardless of the configuration `env_override_existing_values`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/pytest_dotenv/__init__.py
new/pytest-dotenv-0.5.1/pytest_dotenv/__init__.py
--- old/pytest-dotenv-0.4.0/pytest_dotenv/__init__.py 2019-02-21
11:51:11.000000000 +0100
+++ new/pytest-dotenv-0.5.1/pytest_dotenv/__init__.py 2020-06-05
13:25:02.000000000 +0200
@@ -1,2 +1,2 @@
-__version__='0.4.0'
+__version__='0.5.1'
__author__='Marcel Radischat'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/pytest_dotenv/plugin.py
new/pytest-dotenv-0.5.1/pytest_dotenv/plugin.py
--- old/pytest-dotenv-0.4.0/pytest_dotenv/plugin.py 2019-02-21
11:31:06.000000000 +0100
+++ new/pytest-dotenv-0.5.1/pytest_dotenv/plugin.py 2020-06-05
13:25:02.000000000 +0200
@@ -14,10 +14,18 @@
type="bool",
help="override the existing environment variables",
default=False)
+ parser.addoption("--envfile",
+ dest="envfile",
+ default="foo",
+ type=str,
+ help="Overwrite any environment variable specified in this
file. This argument ignores the .ini settings.")
[email protected](tryfirst=True)
-def pytest_load_initial_conftests(args, early_config, parser):
- _override = early_config.getini("env_override_existing_values")
- for filename in early_config.getini("env_files"):
+def pytest_sessionstart(session):
+ config = session.config
+ _override = config.getini("env_override_existing_values")
+ for filename in config.getini("env_files"):
load_dotenv(find_dotenv(filename, usecwd=True), override=_override)
+
+ if config.getoption("envfile", default=None) is not None:
+ load_dotenv(dotenv_path=config.getoption("envfile"), override=True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/PKG-INFO
new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/PKG-INFO
--- old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/PKG-INFO 2019-02-21
11:54:26.000000000 +0100
+++ new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/PKG-INFO 1970-01-01
01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
-Metadata-Version: 1.1
-Name: pytest-dotenv
-Version: 0.4.0
-Summary: A py.test plugin that parses environment files before running tests
-Home-page: https://github.com/quiqua/pytest-dotenv
-Author: Marcel Radischat
-Author-email: [email protected]
-License: UNKNOWN
-Download-URL: https://github.com/quiqua/pytest-dotenv/tarball/0.2.0
-Description: A py.test plugin that parses environment files before running
tests
-Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Natural Language :: English
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/SOURCES.txt
new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/SOURCES.txt
--- old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/SOURCES.txt 2019-02-21
11:54:26.000000000 +0100
+++ new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/SOURCES.txt 1970-01-01
01:00:00.000000000 +0100
@@ -1,13 +0,0 @@
-LICENSE
-MANIFEST.in
-README.md
-setup.cfg
-setup.py
-pytest_dotenv/__init__.py
-pytest_dotenv/plugin.py
-pytest_dotenv.egg-info/PKG-INFO
-pytest_dotenv.egg-info/SOURCES.txt
-pytest_dotenv.egg-info/dependency_links.txt
-pytest_dotenv.egg-info/entry_points.txt
-pytest_dotenv.egg-info/requires.txt
-pytest_dotenv.egg-info/top_level.txt
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/dependency_links.txt
new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/dependency_links.txt
--- old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/dependency_links.txt
2019-02-21 11:54:26.000000000 +0100
+++ new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/dependency_links.txt
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/entry_points.txt
new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/entry_points.txt
--- old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/entry_points.txt
2019-02-21 11:54:26.000000000 +0100
+++ new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/entry_points.txt
1970-01-01 01:00:00.000000000 +0100
@@ -1,3 +0,0 @@
-[pytest11]
-env = pytest_dotenv.plugin
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/requires.txt
new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/requires.txt
--- old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/requires.txt 2019-02-21
11:54:26.000000000 +0100
+++ new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/requires.txt 1970-01-01
01:00:00.000000000 +0100
@@ -1,2 +0,0 @@
-pytest>=2.6.0
-python-dotenv>=0.9.1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/top_level.txt
new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/top_level.txt
--- old/pytest-dotenv-0.4.0/pytest_dotenv.egg-info/top_level.txt
2019-02-21 11:54:26.000000000 +0100
+++ new/pytest-dotenv-0.5.1/pytest_dotenv.egg-info/top_level.txt
1970-01-01 01:00:00.000000000 +0100
@@ -1 +0,0 @@
-pytest_dotenv
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/setup.cfg
new/pytest-dotenv-0.5.1/setup.cfg
--- old/pytest-dotenv-0.4.0/setup.cfg 2019-02-21 11:54:27.000000000 +0100
+++ new/pytest-dotenv-0.5.1/setup.cfg 2020-06-05 13:25:02.000000000 +0200
@@ -1,7 +1,2 @@
[metadata]
-description-file = README.md
-
-[egg_info]
-tag_build =
-tag_date = 0
-
+description-file = README.md
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/setup.py
new/pytest-dotenv-0.5.1/setup.py
--- old/pytest-dotenv-0.4.0/setup.py 2019-02-21 11:50:31.000000000 +0100
+++ new/pytest-dotenv-0.5.1/setup.py 2020-06-05 13:25:02.000000000 +0200
@@ -1,19 +1,26 @@
from setuptools import setup
+from os import path
description = 'A py.test plugin that parses environment files before running
tests'
+# read the contents of the README file
+this_directory = path.abspath(path.dirname(__file__))
+with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
+ long_description = f.read()
+
setup(
name='pytest-dotenv',
description=description,
- long_description=description,
- version='0.4.0',
+ long_description=long_description,
+ long_description_content_type='text/markdown',
+ version='0.5.1',
author='Marcel Radischat',
author_email='[email protected]',
url='https://github.com/quiqua/pytest-dotenv',
- download_url='https://github.com/quiqua/pytest-dotenv/tarball/0.2.0',
+ download_url='https://github.com/quiqua/pytest-dotenv/tarball/0.5.1',
packages=['pytest_dotenv'],
- entry_points={'pytest11': ['env = pytest_dotenv.plugin']},
- install_requires=['pytest>=2.6.0', 'python-dotenv>=0.9.1'],
+ entry_points={'pytest11': ['dotenv = pytest_dotenv.plugin']},
+ install_requires=['pytest>=5.0.0', 'python-dotenv>=0.9.1'],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
@@ -26,6 +33,8 @@
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6'
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: 3.8',
]
)
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/tests/conftest.py
new/pytest-dotenv-0.5.1/tests/conftest.py
--- old/pytest-dotenv-0.4.0/tests/conftest.py 1970-01-01 01:00:00.000000000
+0100
+++ new/pytest-dotenv-0.5.1/tests/conftest.py 2020-06-05 13:25:02.000000000
+0200
@@ -0,0 +1 @@
+pytest_plugins = 'pytester'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-dotenv-0.4.0/tests/test_dotenv.py
new/pytest-dotenv-0.5.1/tests/test_dotenv.py
--- old/pytest-dotenv-0.4.0/tests/test_dotenv.py 1970-01-01
01:00:00.000000000 +0100
+++ new/pytest-dotenv-0.5.1/tests/test_dotenv.py 2020-06-05
13:25:02.000000000 +0200
@@ -0,0 +1,145 @@
+# -*- coding: utf-8 -*-
+from unittest import mock
+
+def test_ini_file(testdir):
+ with mock.patch.dict('os.environ', clear=True):
+ testdir.makeini("""
+ [pytest]
+ env_files =
+ myenv.txt
+ """)
+
+ testdir.maketxtfile(myenv="FOO=BAR\nSPAM=EGGS")
+
+ # create a temporary pytest test module
+ testdir.makepyfile("""
+ import os
+
+ def test_env_foo():
+ assert os.environ.get('FOO') == 'BAR'
+
+ def test_env_spam():
+ assert os.environ.get('SPAM') == 'EGGS'
+ """)
+
+ # run pytest with the following cmd args
+ result = testdir.runpytest("-v")
+
+ # fnmatch_lines does an assertion internally
+ result.stdout.fnmatch_lines([
+ '*::test_env_foo PASSED*',
+ '*::test_env_spam PASSED*'
+ ])
+
+ # make sure that that we get a '0' exit code for the testsuite
+ assert result.ret == 0
+
+
+def test_ini_file_refuse_overwrite(testdir):
+ with mock.patch.dict('os.environ', clear=True):
+ testdir.makeini("""
+ [pytest]
+ env_override_existing_values = 0
+ env_files =
+ myenv.txt
+ overwrite.txt
+ """)
+
+ testdir.maketxtfile(myenv="FOO=BAR\nSPAM=EGGS")
+ testdir.maketxtfile(overwrite="FOO=EGGS\nSPAM=BAR")
+ # create a temporary pytest test module
+ testdir.makepyfile("""
+ import os
+
+ def test_env_foo():
+ assert os.environ.get('FOO') == 'BAR'
+
+ def test_env_spam():
+ assert os.environ.get('SPAM') == 'EGGS'
+ """)
+
+ # run pytest with the following cmd args
+ result = testdir.runpytest("-v")
+
+ # fnmatch_lines does an assertion internally
+ result.stdout.fnmatch_lines([
+ '*::test_env_foo PASSED*',
+ '*::test_env_spam PASSED*'
+ ])
+
+ # make sure that that we get a '0' exit code for the testsuite
+ assert result.ret == 0
+
+
+def test_ini_file_allow_overwrite(testdir):
+ with mock.patch.dict('os.environ', clear=True):
+ testdir.makeini("""
+ [pytest]
+ env_override_existing_values = 1
+ env_files =
+ myenv.txt
+ overwrite.txt
+ """)
+
+ testdir.maketxtfile(myenv="FOO=BAR\nSPAM=EGGS")
+ testdir.maketxtfile(overwrite="FOO=EGGS\nSPAM=BAR")
+ # create a temporary pytest test module
+ testdir.makepyfile("""
+ import os
+
+ def test_env_foo():
+ assert os.environ.get('FOO') == 'EGGS'
+
+ def test_env_spam():
+ assert os.environ.get('SPAM') == 'BAR'
+ """)
+
+ # run pytest with the following cmd args
+ result = testdir.runpytest("-v")
+
+ # fnmatch_lines does an assertion internally
+ result.stdout.fnmatch_lines([
+ '*::test_env_foo PASSED*',
+ '*::test_env_spam PASSED*'
+ ])
+
+ # make sure that that we get a '0' exit code for the testsuite
+ assert result.ret == 0
+
+
+def test_file_argument_force_overwrite(testdir):
+ with mock.patch.dict('os.environ', clear=True):
+ testdir.makeini("""
+ [pytest]
+ env_files =
+ myenv.txt
+ """)
+
+ testdir.maketxtfile(myenv="FOO=BAR\nSPAM=EGGS")
+ tmp_env_file = testdir.maketxtfile(tmpenv="FOO=BAZ\nBAR=SPAM")
+ # create a temporary pytest test module
+ testdir.makepyfile("""
+ import os
+
+ def test_env_foo():
+ assert os.environ.get('FOO') == 'BAZ'
+
+ def test_env_spam():
+ assert os.environ.get('SPAM') == 'EGGS'
+
+ def test_env_bar():
+ assert os.environ.get('BAR') == 'SPAM'
+ """)
+
+ # run pytest with the following cmd args
+ result = testdir.runpytest("-v", "--envfile", str(tmp_env_file))
+
+ # fnmatch_lines does an assertion internally
+ result.stdout.fnmatch_lines([
+ '*::test_env_foo PASSED*',
+ '*::test_env_spam PASSED*',
+ '*::test_env_bar PASSED*'
+ ])
+
+ # make sure that that we get a '0' exit code for the testsuite
+ assert result.ret == 0