2020.4.4: test suite is failing

Create issue
Issue #368 closed
Tomasz Kłoczko created an issue

+ /usr/bin/python3 setup.py test
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing regex.egg-info/PKG-INFO
writing dependency_links to regex.egg-info/dependency_links.txt
writing top-level names to regex.egg-info/top_level.txt
reading manifest file 'regex.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'regex.egg-info/SOURCES.txt'
running build_ext
copying build/lib.linux-x86_64-3.8/regex/_regex.cpython-38-x86_64-linux-gnu.so -> regex_3
regex_2 (unittest.loader._FailedTest) ... ERROR
test_anyall (regex_3.test_regex.RegexTests) ... ok
test_ascii_and_unicode_flag (regex_3.test_regex.RegexTests) ... ok
test_atomic (regex_3.test_regex.RegexTests) ... ok
test_basic_regex_sub (regex_3.test_regex.RegexTests) ... ok
test_bigcharset (regex_3.test_regex.RegexTests) ... ok
test_branch_reset (regex_3.test_regex.RegexTests) ... ok
test_bug_10328 (regex_3.test_regex.RegexTests) ... ok
test_bug_113254 (regex_3.test_regex.RegexTests) ... ok
test_bug_114660 (regex_3.test_regex.RegexTests) ... ok
test_bug_117612 (regex_3.test_regex.RegexTests) ... ok
test_bug_14462 (regex_3.test_regex.RegexTests) ... ok
test_bug_1661 (regex_3.test_regex.RegexTests) ... ok
test_bug_3629 (regex_3.test_regex.RegexTests) ... ok
test_bug_418626 (regex_3.test_regex.RegexTests) ... ok
test_bug_448951 (regex_3.test_regex.RegexTests) ... ok
test_bug_449000 (regex_3.test_regex.RegexTests) ... ok
test_bug_449964 (regex_3.test_regex.RegexTests) ... ok
test_bug_462270 (regex_3.test_regex.RegexTests) ... ok
test_bug_527371 (regex_3.test_regex.RegexTests) ... ok
test_bug_545855 (regex_3.test_regex.RegexTests) ... ok
test_bug_581080 (regex_3.test_regex.RegexTests) ... ok
test_bug_612074 (regex_3.test_regex.RegexTests) ... ok
test_bug_725106 (regex_3.test_regex.RegexTests) ... ok
test_bug_725149 (regex_3.test_regex.RegexTests) ... ok
test_bug_764548 (regex_3.test_regex.RegexTests) ... ok
test_bug_817234 (regex_3.test_regex.RegexTests) ... ok
test_bug_926075 (regex_3.test_regex.RegexTests) ... ok
test_bug_931848 (regex_3.test_regex.RegexTests) ... ok
test_bytes_str_mixing (regex_3.test_regex.RegexTests) ... ok
test_captures (regex_3.test_regex.RegexTests) ... ok
test_case_folding (regex_3.test_regex.RegexTests) ... ok
test_category (regex_3.test_regex.RegexTests) ... ok
test_common_prefix (regex_3.test_regex.RegexTests) ... ok
test_constants (regex_3.test_regex.RegexTests) ... ok
test_copy (regex_3.test_regex.RegexTests) ... ok
test_dollar_matches_twice (regex_3.test_regex.RegexTests) ... ok
test_empty_array (regex_3.test_regex.RegexTests) ... ok
test_expand (regex_3.test_regex.RegexTests) ... ok
test_finditer (regex_3.test_regex.RegexTests) ... ok
test_flags (regex_3.test_regex.RegexTests) ... ok
test_format (regex_3.test_regex.RegexTests) ... ok
test_fullmatch (regex_3.test_regex.RegexTests) ... ok
test_fuzzy (regex_3.test_regex.RegexTests) ... ok
test_fuzzy_ext (regex_3.test_regex.RegexTests) ... /home/tkloczko/rpmbuild/BUILD/regex-2020.4.4/regex_3/test_regex.py:4221: DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(bool(regex.fullmatch(r'(?r)(?:a){e<=1:[a-z]}', 'e')),
ok
test_getattr (regex_3.test_regex.RegexTests) ... ok
test_grapheme (regex_3.test_regex.RegexTests) ... ok
test_groupdict (regex_3.test_regex.RegexTests) ... ok
test_guards (regex_3.test_regex.RegexTests) ... ok
test_hg_bugs (regex_3.test_regex.RegexTests) ... CHARACTER MATCH 'a'
ok
test_ignore_case (regex_3.test_regex.RegexTests) ... ok
test_inline_flags (regex_3.test_regex.RegexTests) ... ok
test_issue_18468 (regex_3.test_regex.RegexTests) ... ok
test_line_boundary (regex_3.test_regex.RegexTests) ... ok
test_lookbehind (regex_3.test_regex.RegexTests) ... ok
test_more_zerowidth (regex_3.test_regex.RegexTests) ... ok
test_named_lists (regex_3.test_regex.RegexTests) ... /usr/lib64/python3.8/site-packages/regex/regex.py:251: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  return _compile(pattern, flags, ignore_unused, kwargs).match(string, pos,
/usr/lib64/python3.8/site-packages/regex/_regex_core.py:296: DeprecationWarning: PY_SSIZE_T_CLEAN will be required for '#' formats
  return _regex.fold_case(flags, string)
ok
test_new_named_groups (regex_3.test_regex.RegexTests) ... ok
test_non_consuming (regex_3.test_regex.RegexTests) ... ok
test_not_literal (regex_3.test_regex.RegexTests) ... ok
test_overlapped (regex_3.test_regex.RegexTests) ... ok
test_partial (regex_3.test_regex.RegexTests) ... ok
test_possessive (regex_3.test_regex.RegexTests) ... ok
test_properties (regex_3.test_regex.RegexTests) ... ok
test_qualified_re_split (regex_3.test_regex.RegexTests) ... ok
test_qualified_re_sub (regex_3.test_regex.RegexTests) ... ok
test_re_escape (regex_3.test_regex.RegexTests) ... ok
test_re_escape_byte (regex_3.test_regex.RegexTests) ... ok
test_re_findall (regex_3.test_regex.RegexTests) ... ok
test_re_groupref (regex_3.test_regex.RegexTests) ... ok
test_re_groupref_exists (regex_3.test_regex.RegexTests) ... ok
test_re_match (regex_3.test_regex.RegexTests) ... ok
test_re_split (regex_3.test_regex.RegexTests) ... ok
test_re_subn (regex_3.test_regex.RegexTests) ... ok
test_recursive (regex_3.test_regex.RegexTests) ... ok
test_repeat_minmax (regex_3.test_regex.RegexTests) ... ok
test_repeated_repeats (regex_3.test_regex.RegexTests) ... ok
test_replacement (regex_3.test_regex.RegexTests) ... ok
test_scanner (regex_3.test_regex.RegexTests) ... ok
test_scoped_and_inline_flags (regex_3.test_regex.RegexTests) ... ok
test_search_anchor (regex_3.test_regex.RegexTests) ... ok
test_search_coverage (regex_3.test_regex.RegexTests) ... ok
test_search_reverse (regex_3.test_regex.RegexTests) ... ok
test_search_star_plus (regex_3.test_regex.RegexTests) ... ok
test_set (regex_3.test_regex.RegexTests) ... ok
test_special_escapes (regex_3.test_regex.RegexTests) ... ok
test_splititer (regex_3.test_regex.RegexTests) ... ok
test_sre_character_class_literals (regex_3.test_regex.RegexTests) ... ok
test_sre_character_literals (regex_3.test_regex.RegexTests) ... ok
test_stack_overflow (regex_3.test_regex.RegexTests) ... ok
test_sub_template_numeric_escape (regex_3.test_regex.RegexTests) ... ok
test_subscripted_captures (regex_3.test_regex.RegexTests) ... ok
test_subscripting_match (regex_3.test_regex.RegexTests) ... ok
test_symbolic_refs (regex_3.test_regex.RegexTests) ... ok
test_turkic (regex_3.test_regex.RegexTests) ... ok
test_unmatched_in_sub (regex_3.test_regex.RegexTests) ... ok
test_various (regex_3.test_regex.RegexTests) ... ok
test_weakref (regex_3.test_regex.RegexTests) ... ok
test_word_boundary (regex_3.test_regex.RegexTests) ... ok
test_word_class (regex_3.test_regex.RegexTests) ... ok
test_zerowidth (regex_3.test_regex.RegexTests) ... ok

======================================================================
ERROR: regex_2 (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: regex_2
Traceback (most recent call last):
  File "/usr/lib64/python3.8/unittest/loader.py", line 470, in _find_test_path
    package = self._get_module_from_name(name)
  File "/usr/lib64/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/tkloczko/rpmbuild/BUILD/regex-2020.4.4/regex_2/__init__.py", line 1, in <module>
    from .regex import *
  File "/home/tkloczko/rpmbuild/BUILD/regex-2020.4.4/regex_2/regex.py", line 500
    except error, e:
                ^
SyntaxError: invalid syntax


----------------------------------------------------------------------
Ran 101 tests in 0.344s

Comments (12)

  1. Matthew Barnett repo owner

    Cannot reproduce. I notice that there are references to the version for Python 2. For example: "ImportError: Failed to import test module: regex_2" and "except error, e:". Are you sure you have the correct version?

  2. Matthew Barnett repo owner

    The traceback suggests that you’re testing the version of regex that’s for Python 2 instead the one that’s for Python 3.

  3. Tomasz Kłoczko reporter

    I have no installed python 2.x. Here is the bash completion output

    $ python
    python3                                       python3.8-x86_64-config                       python3-sip                                   python-config
    python3.8                                     python3-config                                python-argcomplete-check-easy-install-script
    python3.8-config                              python3-flake8                                python-argcomplete-tcs
    
    $ python3 -V
    Python 3.8.2
    

  4. Matthew Barnett repo owner

    I didn’t say that you were using Python 2. I said that you were testing the version of the regex module that’s for Python 2.

  5. Tomasz Kłoczko reporter

    And you have no plans to make it useable with python 3 or where is version for python 3?

  6. Matthew Barnett repo owner

    It has supported Python 3 since Python 3.1!

    On PyPI there are multiple wheels, including manylinux wheels, and a source distribution that contains the versions for Python 2 and Python 3.

    The simplest way to get it is with pip, although I prefer to use the pip module via Python:

    python3 -m pip install regex

  7. Matthew Barnett repo owner

    regex_3 folder => sources targetting Python 3.

    regex_2 folder => sources targetting Python 2.

    But if you can get the tar ball, can’t you also get the appropriate wheel?

    python3 -m pip install /path/to/regex_wheel

  8. Tomasz Kłoczko reporter

    So looks like “/usr/bin/python3 setup.py test” command is testeing in both directories unconditionally and/or is not able to find that it is used python3.

    In other words it is kind of bug ..

    In attached output all python3 tests are passing. Only executing unconditionally python2 tests in that case wrong.

  9. Matthew Barnett repo owner

    When installed, you should be able to run the tests with:

    python3 -c "from regex.test_regex import test_main; test_main()"

  10. Log in to comment