You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/source/contributing.rst
+14-2
Original file line number
Diff line number
Diff line change
@@ -629,7 +629,7 @@ testing of many cases in a concise way that enables an easy-to-read syntax.
629
629
classTestReallyCoolFeature(tm.TestCase):
630
630
....
631
631
632
-
Going forward we are moving to a more *functional* style, please see below.
632
+
Going forward, we are moving to a more *functional* style, please see below.
633
633
634
634
635
635
Here is an example of a self-contained set of tests that illustrate multiple features that we like to use.
@@ -641,7 +641,7 @@ Here is an example of a self-contained set of tests that illustrate multiple fea
641
641
- ``tm.assert_series_equal`` (and its counter part ``tm.assert_frame_equal``), for pandas object comparisons.
642
642
- the typical pattern of constructing an ``expected`` and comparing versus the ``result``
643
643
644
-
We would name this file ``test_cool_feature.py`` and put in an appropriate place in the ``pandas/tests/`` sturcture.
644
+
We would name this file ``test_cool_feature.py`` and put in an appropriate place in the ``pandas/tests/`` structure.
645
645
646
646
.. code-block:: python
647
647
@@ -701,6 +701,18 @@ Tests that we have ``parametrized`` are now accessible via the test name, for ex
701
701
test_cool_feature.py::test_dtypes[int8] PASSED
702
702
test_cool_feature.py::test_series[int8] PASSED
703
703
704
+
Sometimes, it does make sense to bundle test functions together into a single class, either because the test file is testing multiple functions from a single module, and
705
+
using test classes allows for better organization. However, instead of inheriting from ``tm.TestCase``, we just inherit from ``object``, and we can parametrize as before:
0 commit comments