コード例 #1
0
ファイル: test_ipytest.py プロジェクト: AlfonsoRReyes/ipytest
    def test_doctest(self):
        actual = set(ipytest.collect_tests(doctest=True))
        print(actual)
        num_doctests = len(
            {obj
             for obj in actual if isinstance(obj, ipytest._DocTestCase)})

        self.assertEqual(num_doctests, 1)
コード例 #2
0
ファイル: test_ipytest.py プロジェクト: tamuhey/ipytest
    def test_doctest(self):
        # NOTE: do not import globally, otherwise it will be collected by pytest
        from ipytest._unittest_support import _DocTestCase

        actual = set(ipytest.collect_tests(doctest=True))
        num_doctests = len({obj for obj in actual if isinstance(obj, _DocTestCase)})

        self.assertEqual(num_doctests, 1)
コード例 #3
0
ファイル: test_ipytest.py プロジェクト: chmp/ipytest
    def test_doctest(self):
        actual = set(ipytest.collect_tests(doctest=True)) 
        num_doctests = len({
            obj for obj in actual 
            if isinstance(obj, ipytest._DocTestCase)
        })

        self.assertEqual(num_doctests, 1)
コード例 #4
0
ファイル: test_ipytest.py プロジェクト: chmp/ipytest
    def test_self(self):
        actual = set(ipytest.collect_tests()) 
        expected = {
            unittest.FunctionTestCase(test_get_assert_function_numpy),
            unittest.FunctionTestCase(test_get_assert_function_pandas_frame),
            unittest.FunctionTestCase(test_get_assert_function_pandas_series),
            unittest.FunctionTestCase(test_get_assert_function_pandas_panel),
            TestDiscovery("test_self"),
            TestDiscovery("test_doctest"),
            TestAssertEquals('test_nonequal_fails'),
        }

        assert actual == expected
コード例 #5
0
ファイル: test_ipytest.py プロジェクト: AlfonsoRReyes/ipytest
    def test_self(self):
        actual = set(ipytest.collect_tests())
        print(actual)
        expected = {
            unittest.FunctionTestCase(test_get_assert_function_numpy),
            unittest.FunctionTestCase(test_get_assert_function_pandas_frame),
            unittest.FunctionTestCase(test_get_assert_function_pandas_series),
            unittest.FunctionTestCase(test_get_assert_function_pandas_panel),
            TestDiscovery("test_self"),
            TestDiscovery("test_doctest"),
            TestAssertEquals('test_nonequal_fails'),
        }

        assert actual == expected