Repository: briancurtin/deprecation

Issue:
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.


Discussion:
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?

Patch:
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


Test patch:
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")