[New-bugs-announce] [issue34236] Test6012 in test_capi is not run as part of make test

Karthikeyan Singaravelan report at bugs.python.org
Thu Jul 26 09:42:17 EDT 2018


New submission from Karthikeyan Singaravelan <tir.karthi at gmail.com>:

Test6012 is not run as part of make test since it's not added to support.run_unittest at the end of the file. Hence running the test as a single file causes error. It seems argparsing related test which is a part of _testcapi.module.c in Python 3 branch was not cleanly backported and I tried backporting it but it requires PyUnicode_FSConverter which I think is Python 3 only. Since the test was not running during make test there was no error about this during backporting during merge.

Relevant backport commit : ef19fd200d0768919f1658466f8b6080b191fba0

# No argparsing defined in _testcapimodule.c

➜  cpython git:(1c8f655) grep -inr argparsing *
Lib/test/test_capi.py:108:        self.assertEqual(_testcapi.argparsing("Hello", "World"), 1)
➜  cpython git:(1c8f655) grep -inr PyUnicode_FSConverter *

# Test case failure

➜  cpython git:(1c8f655) ./python -m unittest -v test.test_capi
test_buildvalue_N (test.test_capi.CAPITest) ... ok
test_bad_use (test.test_capi.SkipitemTest) ... ok
test_parse_tuple_and_keywords (test.test_capi.SkipitemTest) ... ok
test_skipitem (test.test_capi.SkipitemTest) ... ok
test_skipitem_with_suffix (test.test_capi.SkipitemTest) ... ok
test (test.test_capi.Test6012) ... ERROR
test_pendingcalls_non_threaded (test.test_capi.TestPendingCalls) ... ok
test_pendingcalls_threaded (test.test_capi.TestPendingCalls) ... ok
test_thread_state (test.test_capi.TestThreadState) ... ok

======================================================================
ERROR: test (test.test_capi.Test6012)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/cpython/Lib/test/test_capi.py", line 108, in test
    self.assertEqual(_testcapi.argparsing("Hello", "World"), 1)
AttributeError: 'module' object has no attribute 'argparsing'

----------------------------------------------------------------------
Ran 9 tests in 2.753s

FAILED (errors=1)

# Test passes because Test6012 is not added to support.run_unittest

➜  cpython git:(1c8f655) ./python Lib/test/test_capi.py
internal test_L_code
internal test_broken_memoryview
internal test_buildvalue_N
internal test_capsule
internal test_config
internal test_datetime_capi
internal test_dict_iteration
internal test_empty_argparse
internal test_from_contiguous
internal test_k_code
internal test_lazy_hash_inheritance
internal test_list_api
internal test_long_and_overflow
internal test_long_api
internal test_long_long_and_overflow
internal test_long_numbits
internal test_longlong_api
internal test_null_strings
internal test_string_from_format
internal test_to_contiguous
internal test_u_code
internal test_widechar
internal test_with_docstring
test_buildvalue_N (__main__.CAPITest) ... ok
test_pendingcalls_non_threaded (__main__.TestPendingCalls) ... ok
test_pendingcalls_threaded (__main__.TestPendingCalls) ... ok
test_bad_use (__main__.SkipitemTest) ... ok
test_parse_tuple_and_keywords (__main__.SkipitemTest) ... ok
test_skipitem (__main__.SkipitemTest) ... ok
test_skipitem_with_suffix (__main__.SkipitemTest) ... ok
test_thread_state (__main__.TestThreadState) ... ok

----------------------------------------------------------------------
Ran 8 tests in 2.741s

OK

Adding serhiy.storchaka who did the relevant backport.


Thanks

----------
components: Build
messages: 322423
nosy: serhiy.storchaka, xtreak
priority: normal
severity: normal
status: open
title: Test6012 in test_capi is not run as part of make test
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34236>
_______________________________________


More information about the New-bugs-announce mailing list