Skip to content

Commit 0ee459b

Browse files
splitted test functions
1 parent d3e4538 commit 0ee459b

File tree

1 file changed

+57
-3
lines changed

1 file changed

+57
-3
lines changed

tests/test_doctestplus.py

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ def test_doctest_skip(testdir):
777777
testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(skipped=1)
778778

779779

780-
def test_remote_data(testdir):
780+
def test_remote_data_on(testdir):
781781
testdir.makeini(
782782
"""
783783
[pytest]
@@ -796,6 +796,14 @@ def test_remote_data(testdir):
796796
testdir.inline_run(p, '--doctest-plus', '--doctest-rst',
797797
'--remote-data').assertoutcome(passed=1)
798798

799+
800+
def test_remote_data_off(testdir):
801+
testdir.makeini(
802+
"""
803+
[pytest]
804+
doctestplus = enabled
805+
""")
806+
799807
p = testdir.makefile(
800808
'.rst',
801809
"""
@@ -814,11 +822,19 @@ def test_remote_data(testdir):
814822
)
815823
testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(skipped=1)
816824

825+
826+
def test_remote_data_float_cmp(testdir):
827+
testdir.makeini(
828+
"""
829+
[pytest]
830+
doctestplus = enabled
831+
""")
832+
817833
p = testdir.makefile(
818834
'.rst',
819835
"""
820836
#This test is skipped when remote data is not requested, and should
821-
# fail when remote data is requested
837+
# fail when remote data is requested
822838
.. doctest-remote-data::
823839
>>> x = 1/3.
824840
>>> x # doctest: +FLOAT_CMP
@@ -829,6 +845,15 @@ def test_remote_data(testdir):
829845
)
830846
testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(skipped=1)
831847

848+
849+
def test_remote_data_ellipsis(testdir):
850+
testdir.makeini(
851+
"""
852+
[pytest]
853+
doctest_optionflags = ELLIPSIS
854+
doctestplus = enabled
855+
""")
856+
832857
p = testdir.makefile(
833858
'.rst',
834859
"""
@@ -843,15 +868,44 @@ def test_remote_data(testdir):
843868
)
844869
testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(skipped=1)
845870

871+
872+
def test_remote_data_requires(testdir):
873+
testdir.makeini(
874+
"""
875+
[pytest]
876+
doctestplus = enabled
877+
""")
878+
846879
p = testdir.makefile(
847880
'.rst',
848881
"""
849882
#This test should be skipped even if remote data is requested because
850-
# the module required does not exist
883+
#the module required does not exist
851884
.. doctest-remote-data::
852885
.. doctest-requires:: does-not-exist
853886
>>> 1 + 1
854887
3
855888
"""
856889
)
857890
testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(skipped=1)
891+
892+
893+
def test_remote_data_ignore_warnings(testdir):
894+
testdir.makeini(
895+
"""
896+
[pytest]
897+
doctestplus = enabled
898+
""")
899+
900+
p = testdir.makefile(
901+
'.rst',
902+
"""
903+
#This test should be skipped if remote data is not requested.
904+
.. doctest-remote-data::
905+
>>> 1 + 1
906+
3
907+
>>> import warnings
908+
>>> warnings.warn('A warning occurred', UserWarning) # doctest: +IGNORE_WARNINGS
909+
"""
910+
)
911+
testdir.inline_run(p, '--doctest-plus', '--doctest-rst').assertoutcome(skipped=1)

0 commit comments

Comments
 (0)