From 6b135c83be8cef769dbc860a4706a95603d01d09 Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Wed, 22 Jun 2016 12:21:51 +0200 Subject: [PATCH 1/9] Initial commit. --- .gitignore | 6 ++++++ LICENSE | 19 ++++++++++++++++++ README.rst | 37 ++++++++++++++++++++++++++++++++++ pytest_warnings.py | 50 ++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 17 ++++++++++++++++ test_warnings.py | 27 +++++++++++++++++++++++++ test_warnings2.py | 20 +++++++++++++++++++ tox.ini | 17 ++++++++++++++++ 8 files changed, 193 insertions(+) create mode 100644 .gitignore create mode 100755 LICENSE create mode 100644 README.rst create mode 100644 pytest_warnings.py create mode 100644 setup.py create mode 100644 test_warnings.py create mode 100644 test_warnings2.py create mode 100644 tox.ini diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..dac3fe1aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +/.cache/ +/.tox/ +/bin/ +/include/ +/lib/ +/pip-selfcheck.json diff --git a/LICENSE b/LICENSE new file mode 100755 index 000000000..8a30978e3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + diff --git a/README.rst b/README.rst new file mode 100644 index 000000000..02389db73 --- /dev/null +++ b/README.rst @@ -0,0 +1,37 @@ +pytest-warnings +=============== + +py.test plugin to list Python warnings in pytest report + + +Usage +----- + +install via:: + + pip install pytest-warnings + +if you then type:: + + py.test -rw + +any warnings in your code are reported in the pytest report. +You can use the ``-W`` option or ``--pythonwarnings`` exactly like for the ``python`` executable. + +The following example ignores all warnings, but prints DeprecationWarnings once per occurrence:: + + py.test -rw -W ignore -W once::DeprecationWarning + +You can also turn warnings into actual errors:: + + py.test -W error + + +Changes +======= + +0.1 - Unreleased +---------------- + +- Initial release. + [fschulze (Florian Schulze)] diff --git a/pytest_warnings.py b/pytest_warnings.py new file mode 100644 index 000000000..1813cf519 --- /dev/null +++ b/pytest_warnings.py @@ -0,0 +1,50 @@ +from _pytest.recwarn import RecordedWarning, WarningsRecorder +import inspect +import os +import pytest +import warnings + + +def pytest_addoption(parser): + group = parser.getgroup("pytest-warnings") + group.addoption( + '-W', '--pythonwarnings', action='append', + help="set which warnings to report, see ...") + + +@pytest.hookimpl(hookwrapper=True) +def pytest_runtest_call(item): + wrec = WarningsRecorder() + + def showwarning(message, category, filename, lineno, file=None, line=None): + frame = inspect.currentframe() + if '/_pytest/recwarn' in frame.f_back.f_code.co_filename: + # we are in test recorder, so this warning is already handled + return + wrec._list.append(RecordedWarning( + message, category, filename, lineno, file, line)) + # still perform old showwarning functionality + wrec._showwarning( + message, category, filename, lineno, file=file, line=line) + + args = item.config.getoption('pythonwarnings') or [] + with wrec: + _showwarning = wrec._showwarning + warnings.showwarning = showwarning + wrec._module.simplefilter('once') + for arg in args: + wrec._module._setoption(arg) + yield + wrec._showwarning = _showwarning + + for warning in wrec.list: + msg = warnings.formatwarning( + warning.message, warning.category, + os.path.relpath(warning.filename), warning.lineno, warning.line) + fslocation = getattr(item, "location", None) + if fslocation is None: + fslocation = getattr(item, "fspath", None) + else: + fslocation = "%s:%s" % fslocation[:2] + fslocation = "in %s the following warning was recorded:\n" % fslocation + item.config.warn("W0", msg, fslocation=fslocation) diff --git a/setup.py b/setup.py new file mode 100644 index 000000000..fd478664c --- /dev/null +++ b/setup.py @@ -0,0 +1,17 @@ +from setuptools import setup + + +setup( + name="pytest-warnings", + description='pytest plugin to list Python warnings in pytest report', + long_description=open("README.rst").read(), + license="MIT license", + version='0.1.0', + author='Florian Schulze', + author_email='florian.schulze@gmx.net', + url='https://github.com/fschulze/pytest-warnings', + py_modules=["pytest_warnings"], + entry_points={'pytest11': ['pytest_warnings = pytest_warnings']}, + install_requires=['pytest'], + classifiers=[ + "Framework :: Pytest"]) diff --git a/test_warnings.py b/test_warnings.py new file mode 100644 index 000000000..62167992f --- /dev/null +++ b/test_warnings.py @@ -0,0 +1,27 @@ +import pytest +import warnings + + +def test_warnings(): + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + + +def test_warnings1(): + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + + +def test_warn(): + with pytest.warns(DeprecationWarning): + warnings.warn("Bar", DeprecationWarning) diff --git a/test_warnings2.py b/test_warnings2.py new file mode 100644 index 000000000..d4c9be0ea --- /dev/null +++ b/test_warnings2.py @@ -0,0 +1,20 @@ +def test_warnings(): + import warnings + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + + +def test_warnings1(): + import warnings + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", RuntimeWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) + warnings.warn("Foo", DeprecationWarning) diff --git a/tox.ini b/tox.ini new file mode 100644 index 000000000..977819b65 --- /dev/null +++ b/tox.ini @@ -0,0 +1,17 @@ +[tox] +envlist = py27,py33,py34,py35 + +[testenv] +usedevelop = true +deps = + pytest + pytest-flakes + pytest-pep8 + coverage +commands = + {envbindir}/py.test --junitxml={envlogdir}/junit-{envname}.xml {posargs} + +[pytest] +addopts = --flakes --pep8 +pep8ignore = E501 +norecursedirs = bin lib include Scripts .* From b9c4ecf5a86aa9054234f4f2f7b99a7030b5b1d7 Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Mon, 27 Jun 2016 11:32:38 +0200 Subject: [PATCH 2/9] Add MANIFEST.in. --- MANIFEST.in | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 MANIFEST.in diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 000000000..fb7dc7474 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include README.rst +include tox.ini +include LICENSE +include test*.py From 3feee0c48386f172effd8056361cce4a1b87ef4e Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Mon, 27 Jun 2016 11:32:54 +0200 Subject: [PATCH 3/9] Prepare 0.1 release. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 02389db73..aa8146bed 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,7 @@ You can also turn warnings into actual errors:: Changes ======= -0.1 - Unreleased +0.1 - 2016-06-27 ---------------- - Initial release. From bc5a8c761e596fbfc661adb26889951140622203 Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Mon, 27 Jun 2016 11:33:36 +0200 Subject: [PATCH 4/9] Fix version in readme. --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index aa8146bed..483d258ea 100644 --- a/README.rst +++ b/README.rst @@ -30,8 +30,8 @@ You can also turn warnings into actual errors:: Changes ======= -0.1 - 2016-06-27 ----------------- +0.1.0 - 2016-06-27 +------------------ - Initial release. [fschulze (Florian Schulze)] From bc94a51a965ef20e9a66fc678718ce20746a1a0b Mon Sep 17 00:00:00 2001 From: Matthias Bussonnier Date: Mon, 17 Oct 2016 11:34:30 -0700 Subject: [PATCH 5/9] Add a warning option which does not escape its arguments. This is useful when to use regular expressions, like for example ignore a bunch of dynamic messages --filterwarnigns 'ignore:Please use assert.* instead.:' Or ignore all the warnings in a sub-backage --filterwarnigns 'ignore:::package.submodule.*' This is also available in the ini file as the filterwarnigns options --- README.rst | 21 ++++++++++++++ helper_test_a.py | 10 +++++++ helper_test_b.py | 11 ++++++++ pytest_warnings.py | 35 +++++++++++++++++++++++- test_warnings.py | 68 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 144 insertions(+), 1 deletion(-) create mode 100644 helper_test_a.py create mode 100644 helper_test_b.py diff --git a/README.rst b/README.rst index 483d258ea..def6147ca 100644 --- a/README.rst +++ b/README.rst @@ -27,6 +27,27 @@ You can also turn warnings into actual errors:: py.test -W error +Advance usage +============= + +You can get more fine grained filtering of warnings by using the +``filterwarnings`` configuration option. + +``filterwarnings`` works like the python's ``-W`` flag except it will not +escape special characters. + +Example +------- + +.. code:: + + # pytest.ini + [pytest] + filterwarnings= default + ignore:.*is deprecated.*:Warning + error::DeprecationWarning:importlib.* + + Changes ======= diff --git a/helper_test_a.py b/helper_test_a.py new file mode 100644 index 000000000..ba88aa31d --- /dev/null +++ b/helper_test_a.py @@ -0,0 +1,10 @@ +import warnings + + +def deprecated_a(): + """ + A warning triggered in __this__ module for testing. + """ + globals()['__warningregistry__'] = {} + warnings.warn("This is deprecated message_a", + DeprecationWarning, stacklevel=0) diff --git a/helper_test_b.py b/helper_test_b.py new file mode 100644 index 000000000..3c00a6114 --- /dev/null +++ b/helper_test_b.py @@ -0,0 +1,11 @@ +import warnings + + +def user_warning_b(): + """ + A warning triggered in __this__ module for testing. + """ + # reset the "once" filters + # globals()['__warningregistry__'] = {} + warnings.warn("This is deprecated message_b different from a", + UserWarning, stacklevel=1) diff --git a/pytest_warnings.py b/pytest_warnings.py index 1813cf519..84f64ea92 100644 --- a/pytest_warnings.py +++ b/pytest_warnings.py @@ -5,11 +5,39 @@ import pytest import warnings +def _setoption(wmod, arg): + """ + Copy of the warning._setoption function but does not escape arguments. + """ + parts = arg.split(':') + if len(parts) > 5: + raise wmod._OptionError("too many fields (max 5): %r" % (arg,)) + while len(parts) < 5: + parts.append('') + action, message, category, module, lineno = [s.strip() + for s in parts] + action = wmod._getaction(action) + category = wmod._getcategory(category) + if lineno: + try: + lineno = int(lineno) + if lineno < 0: + raise ValueError + except (ValueError, OverflowError): + raise wmod._OptionError("invalid lineno %r" % (lineno,)) + else: + lineno = 0 + wmod.filterwarnings(action, message, category, module, lineno) + + def pytest_addoption(parser): group = parser.getgroup("pytest-warnings") group.addoption( '-W', '--pythonwarnings', action='append', - help="set which warnings to report, see ...") + help="set which warnings to report, see -W option of python itself.") + parser.addini("filterwarnings", type="linelist", + help="Each line specifies warning filter pattern which would be passed" + "to warnings.filterwarnings. Process after -W and --pythonwarnings.") @pytest.hookimpl(hookwrapper=True) @@ -28,12 +56,17 @@ def pytest_runtest_call(item): message, category, filename, lineno, file=file, line=line) args = item.config.getoption('pythonwarnings') or [] + inifilters = item.config.getini("filterwarnings") with wrec: _showwarning = wrec._showwarning warnings.showwarning = showwarning wrec._module.simplefilter('once') for arg in args: wrec._module._setoption(arg) + + for arg in inifilters: + _setoption(wrec._module, arg) + yield wrec._showwarning = _showwarning diff --git a/test_warnings.py b/test_warnings.py index 62167992f..bc65220c7 100644 --- a/test_warnings.py +++ b/test_warnings.py @@ -1,6 +1,10 @@ import pytest import warnings +from pytest_warnings import _setoption +from helper_test_a import deprecated_a +from helper_test_b import user_warning_b + def test_warnings(): warnings.warn("Foo", DeprecationWarning) @@ -25,3 +29,67 @@ def test_warnings1(): def test_warn(): with pytest.warns(DeprecationWarning): warnings.warn("Bar", DeprecationWarning) + + +# This section test the ability to filter selectively warnings using regular +# expressions on messages. + +def test_filters_setoption(): + "A alone works" + + with pytest.warns(DeprecationWarning): + deprecated_a() + + +def test_filters_setoption_2(): + "B alone works" + + with pytest.warns(UserWarning) as record: + user_warning_b() + + assert len(record) == 1 + + +def test_filters_setoption_3(): + "A and B works" + + with pytest.warns(None) as record: + user_warning_b() + deprecated_a() + assert len(record) == 2 + + +def test_filters_setoption_4(): + "A works, B is filtered" + + with pytest.warns(None) as record: + _setoption(warnings, 'ignore:.*message_a.*') + deprecated_a() + user_warning_b() + + assert len(record) == 1, "Only `A` should be filtered out" + + +def test_filters_setoption_4b(): + "A works, B is filtered" + + with pytest.warns(None) as record: + _setoption(warnings, 'ignore:.*message_b.*') + _setoption(warnings, 'ignore:.*message_a.*') + _setoption(warnings, 'always:::.*helper_test_a.*') + deprecated_a() + user_warning_b() + + assert len(record) == 1, "`A` and `B` should be visible, second filter reenable A" + + +def test_filters_setoption_5(): + "B works, A is filtered" + + with pytest.warns(None) as records: + _setoption(warnings, 'always:::.*helper_test_a.*') + _setoption(warnings, 'ignore::UserWarning') + deprecated_a() + user_warning_b() + + assert len(records) == 1, "Only `B` should be filtered out" From f229b573fa57d69fa55ad3280f03c5a3525aa9bc Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Mon, 24 Oct 2016 12:08:00 +0200 Subject: [PATCH 6/9] Bump version, add changelog entry and move stuff around for added coverage reporting. --- .gitignore | 3 +++ MANIFEST.in | 2 +- README.rst | 7 +++++++ pytest_warnings.py => pytest_warnings/__init__.py | 0 setup.py | 4 ++-- helper_test_a.py => tests/helper_test_a.py | 0 helper_test_b.py => tests/helper_test_b.py | 0 test_warnings.py => tests/test_warnings.py | 0 test_warnings2.py => tests/test_warnings2.py | 0 tox.ini | 3 ++- 10 files changed, 15 insertions(+), 4 deletions(-) rename pytest_warnings.py => pytest_warnings/__init__.py (100%) rename helper_test_a.py => tests/helper_test_a.py (100%) rename helper_test_b.py => tests/helper_test_b.py (100%) rename test_warnings.py => tests/test_warnings.py (100%) rename test_warnings2.py => tests/test_warnings2.py (100%) diff --git a/.gitignore b/.gitignore index dac3fe1aa..80b4d47de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ /.cache/ +/.coverage /.tox/ /bin/ +/dist/ +/htmlcov/ /include/ /lib/ /pip-selfcheck.json diff --git a/MANIFEST.in b/MANIFEST.in index fb7dc7474..1652af658 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include README.rst include tox.ini include LICENSE -include test*.py +include tests/*.py diff --git a/README.rst b/README.rst index def6147ca..63e5feff3 100644 --- a/README.rst +++ b/README.rst @@ -51,6 +51,13 @@ Example Changes ======= +0.2.0 - Unreleased +------------------ + +- Add ``filterwarnings`` option. + [Carreau (Matthias Bussonnier)] + + 0.1.0 - 2016-06-27 ------------------ diff --git a/pytest_warnings.py b/pytest_warnings/__init__.py similarity index 100% rename from pytest_warnings.py rename to pytest_warnings/__init__.py diff --git a/setup.py b/setup.py index fd478664c..ea4d193fd 100644 --- a/setup.py +++ b/setup.py @@ -6,11 +6,11 @@ setup( description='pytest plugin to list Python warnings in pytest report', long_description=open("README.rst").read(), license="MIT license", - version='0.1.0', + version='0.2.0', author='Florian Schulze', author_email='florian.schulze@gmx.net', url='https://github.com/fschulze/pytest-warnings', - py_modules=["pytest_warnings"], + packages=['pytest_warnings'], entry_points={'pytest11': ['pytest_warnings = pytest_warnings']}, install_requires=['pytest'], classifiers=[ diff --git a/helper_test_a.py b/tests/helper_test_a.py similarity index 100% rename from helper_test_a.py rename to tests/helper_test_a.py diff --git a/helper_test_b.py b/tests/helper_test_b.py similarity index 100% rename from helper_test_b.py rename to tests/helper_test_b.py diff --git a/test_warnings.py b/tests/test_warnings.py similarity index 100% rename from test_warnings.py rename to tests/test_warnings.py diff --git a/test_warnings2.py b/tests/test_warnings2.py similarity index 100% rename from test_warnings2.py rename to tests/test_warnings2.py diff --git a/tox.ini b/tox.ini index 977819b65..ec2e5622d 100644 --- a/tox.ini +++ b/tox.ini @@ -5,6 +5,7 @@ envlist = py27,py33,py34,py35 usedevelop = true deps = pytest + pytest-cov pytest-flakes pytest-pep8 coverage @@ -12,6 +13,6 @@ commands = {envbindir}/py.test --junitxml={envlogdir}/junit-{envname}.xml {posargs} [pytest] -addopts = --flakes --pep8 +addopts = --flakes --pep8 --cov pytest_warnings --cov tests --no-cov-on-fail pep8ignore = E501 norecursedirs = bin lib include Scripts .* From ce138060acd9107efac1365a96b14ee8e839c0d9 Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Mon, 24 Oct 2016 12:09:49 +0200 Subject: [PATCH 7/9] Prepare pytest-warnings 0.2.0. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 63e5feff3..86d1d0985 100644 --- a/README.rst +++ b/README.rst @@ -51,7 +51,7 @@ Example Changes ======= -0.2.0 - Unreleased +0.2.0 - 2016-10-24 ------------------ - Add ``filterwarnings`` option. From 6ec0c3f3690efb500155a44b65c0f1719dad905b Mon Sep 17 00:00:00 2001 From: Florian Schulze Date: Mon, 24 Oct 2016 12:10:49 +0200 Subject: [PATCH 8/9] Bump. --- README.rst | 5 +++++ setup.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 86d1d0985..c598259c3 100644 --- a/README.rst +++ b/README.rst @@ -51,6 +51,11 @@ Example Changes ======= +0.3.0 - Unreleased +------------------ + + + 0.2.0 - 2016-10-24 ------------------ diff --git a/setup.py b/setup.py index ea4d193fd..19a4c6e80 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( description='pytest plugin to list Python warnings in pytest report', long_description=open("README.rst").read(), license="MIT license", - version='0.2.0', + version='0.3.0.dev0', author='Florian Schulze', author_email='florian.schulze@gmx.net', url='https://github.com/fschulze/pytest-warnings', From e31421a5d242739f44531cfc6525984c5f99046d Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 21 Nov 2016 07:27:26 -0200 Subject: [PATCH 9/9] Moving all stuff to a subdirectory to try to retain history --- .gitignore => warnings-root/.gitignore | 0 LICENSE => warnings-root/LICENSE | 0 MANIFEST.in => warnings-root/MANIFEST.in | 0 README.rst => warnings-root/README.rst | 0 {pytest_warnings => warnings-root/pytest_warnings}/__init__.py | 0 setup.py => warnings-root/setup.py | 0 {tests => warnings-root/tests}/helper_test_a.py | 0 {tests => warnings-root/tests}/helper_test_b.py | 0 {tests => warnings-root/tests}/test_warnings.py | 0 {tests => warnings-root/tests}/test_warnings2.py | 0 tox.ini => warnings-root/tox.ini | 0 11 files changed, 0 insertions(+), 0 deletions(-) rename .gitignore => warnings-root/.gitignore (100%) rename LICENSE => warnings-root/LICENSE (100%) mode change 100755 => 100644 rename MANIFEST.in => warnings-root/MANIFEST.in (100%) rename README.rst => warnings-root/README.rst (100%) rename {pytest_warnings => warnings-root/pytest_warnings}/__init__.py (100%) rename setup.py => warnings-root/setup.py (100%) rename {tests => warnings-root/tests}/helper_test_a.py (100%) rename {tests => warnings-root/tests}/helper_test_b.py (100%) rename {tests => warnings-root/tests}/test_warnings.py (100%) rename {tests => warnings-root/tests}/test_warnings2.py (100%) rename tox.ini => warnings-root/tox.ini (100%) diff --git a/.gitignore b/warnings-root/.gitignore similarity index 100% rename from .gitignore rename to warnings-root/.gitignore diff --git a/LICENSE b/warnings-root/LICENSE old mode 100755 new mode 100644 similarity index 100% rename from LICENSE rename to warnings-root/LICENSE diff --git a/MANIFEST.in b/warnings-root/MANIFEST.in similarity index 100% rename from MANIFEST.in rename to warnings-root/MANIFEST.in diff --git a/README.rst b/warnings-root/README.rst similarity index 100% rename from README.rst rename to warnings-root/README.rst diff --git a/pytest_warnings/__init__.py b/warnings-root/pytest_warnings/__init__.py similarity index 100% rename from pytest_warnings/__init__.py rename to warnings-root/pytest_warnings/__init__.py diff --git a/setup.py b/warnings-root/setup.py similarity index 100% rename from setup.py rename to warnings-root/setup.py diff --git a/tests/helper_test_a.py b/warnings-root/tests/helper_test_a.py similarity index 100% rename from tests/helper_test_a.py rename to warnings-root/tests/helper_test_a.py diff --git a/tests/helper_test_b.py b/warnings-root/tests/helper_test_b.py similarity index 100% rename from tests/helper_test_b.py rename to warnings-root/tests/helper_test_b.py diff --git a/tests/test_warnings.py b/warnings-root/tests/test_warnings.py similarity index 100% rename from tests/test_warnings.py rename to warnings-root/tests/test_warnings.py diff --git a/tests/test_warnings2.py b/warnings-root/tests/test_warnings2.py similarity index 100% rename from tests/test_warnings2.py rename to warnings-root/tests/test_warnings2.py diff --git a/tox.ini b/warnings-root/tox.ini similarity index 100% rename from tox.ini rename to warnings-root/tox.ini