codecov-io: # [Codecov](https://codecov.io/gh/briancurtin/deprecation/pull/37?src=pr&el=h1) Report
> Merging [#37](https://codecov.io/gh/briancurtin/deprecation/pull/37?src=pr&el=desc) into [master](https://codecov.io/gh/briancurtin/deprecation/commit/c9f228e5900f1875ba304f7da57fedf39ecd2dab?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/briancurtin/deprecation/pull/37/graphs/tree.svg?width=650&token=6w8zqu2CEQ&height=150&src=pr)](https://codecov.io/gh/briancurtin/deprecation/pull/37?src=pr&el=tree)

```diff
@@          Coverage Diff          @@
##           master    #37   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          83     83           
  Branches       16     16           
=====================================
  Hits           83     83
```


| [Impacted Files](https://codecov.io/gh/briancurtin/deprecation/pull/37?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [deprecation.py](https://codecov.io/gh/briancurtin/deprecation/pull/37/diff?src=pr&el=tree#diff-ZGVwcmVjYXRpb24ucHk=) | `100% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/briancurtin/deprecation/pull/37?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/briancurtin/deprecation/pull/37?src=pr&el=footer). Last update [c9f228e...0e109a0](https://codecov.io/gh/briancurtin/deprecation/pull/37?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

briancurtin: @BrandonHoffman does this help you out?
diff --git a/deprecation.py b/deprecation.py
index 7a80adc..dbeb39e 100644
--- a/deprecation.py
+++ b/deprecation.py
@@ -56,7 +56,8 @@ class DeprecatedWarning(DeprecationWarning):
         self.deprecated_in = deprecated_in
         self.removed_in = removed_in
         self.details = details
-        super(DeprecatedWarning, self).__init__()
+        super(DeprecatedWarning, self).__init__(function, deprecated_in,
+                                                removed_in, details)
 
     def __str__(self):
         # Use a defaultdict to give us the empty string

args not set on warning
```
>>> warn = deprecation.DeprecatedWarning("depricated", 1, 2)
>>> warn.args
()
```

currently warnings generated through this module do not set the args property. This is making the library incomparable with the latest release of pytest-xdist since they are using those args as a way of recreating the warning on the manager thread.

diff --git a/tests/test_deprecation.py b/tests/test_deprecation.py
index 7e4318e..4d294ba 100644
--- a/tests/test_deprecation.py
+++ b/tests/test_deprecation.py
@@ -20,6 +20,11 @@ import deprecation
 
 class Test_deprecated(unittest2.TestCase):
 
+    def test_args_set_on_base_class(self):
+        args = (1, 2, 3, 4)
+        dw = deprecation.DeprecatedWarning(*args)
+        self.assertEqual(dw.args, args)
+
     def test_removing_without_deprecating(self):
         self.assertRaises(TypeError, deprecation.deprecated,
                           deprecated_in=None, removed_in="1.0")

pip install -e .
parse_log_pytest
requirements.txt
coverage codecov flake8 pytest
3.7
test-requirements.txt docs-requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
codecov==2.1.13
coverage==7.2.7
-e git+https://github.com/briancurtin/deprecation.git@c9f228e5900f1875ba304f7da57fedf39ecd2dab#egg=deprecation
exceptiongroup==1.2.2
flake8==5.0.4
idna==3.10
importlib-metadata==4.2.0
iniconfig==2.0.0
linecache2==1.0.0
mccabe==0.7.0
packaging==24.0
pluggy==1.2.0
pycodestyle==2.9.1
pyflakes==2.5.0
pytest==7.4.4
requests==2.31.0
six==1.17.0
tomli==2.0.1
traceback2==1.4.0
typing_extensions==4.7.1
unittest2==1.1.0
urllib3==2.0.7
zipp==3.15.0

name: deprecation
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - argparse==1.4.0
      - charset-normalizer==3.4.1
      - codecov==2.1.13
      - coverage==7.2.7
      - exceptiongroup==1.2.2
      - flake8==5.0.4
      - idna==3.10
      - importlib-metadata==4.2.0
      - iniconfig==2.0.0
      - linecache2==1.0.0
      - mccabe==0.7.0
      - packaging==24.0
      - pluggy==1.2.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pytest==7.4.4
      - requests==2.31.0
      - six==1.17.0
      - tomli==2.0.1
      - traceback2==1.4.0
      - typing-extensions==4.7.1
      - unittest2==1.1.0
      - urllib3==2.0.7
      - zipp==3.15.0
prefix: /opt/conda/envs/deprecation

tests/test_deprecation.py::Test_deprecated::test_args_set_on_base_class
tests/test_deprecation.py::Test_deprecated::test_DeprecatedWarning_not_raised tests/test_deprecation.py::Test_deprecated::test_docstring tests/test_deprecation.py::Test_deprecated::test_multiline_docstring tests/test_deprecation.py::Test_deprecated::test_multiline_docstring_top tests/test_deprecation.py::Test_deprecated::test_multiline_fallback tests/test_deprecation.py::Test_deprecated::test_removing_without_deprecating tests/test_deprecation.py::Test_deprecated::test_warning_raised tests/test_deprecation.py::Test_fail_if_not_removed::test_DeprecatedWarning_doesnt_fail tests/test_deprecation.py::Test_fail_if_not_removed::test_UnsupportedWarning_causes_failure tests/test_deprecation.py::Test_fail_if_not_removed::test_literal_DeprecatedWarning
deprecation.py
deprecation.py