I am receiving an unexpected behavior in using regular expressions for splitting a string. It seems like this error exists in `python 3.6` but not `python 2.7` and not `python 3.7+`. Below I have described a minimal example with `tox`.
`setup.py`
```
from setuptools import setup
setup(
name='my-tox-tested-package',
version='0.0.1',
install_requires=["pytest"]
)
```
`tests/test_re.py`
```
import re
import pytest
_DIGIT_BOUNDARY_RE = re.compile(
r'(?<=\D)(?=\d)|(?<=\d)(?=\D)'
)
def test():
_DIGIT_BOUNDARY_RE.split("10.0.0")
```
`tox.ini`
```
[tox]
envlist = py27, py36, py37
requires=
pytest
[testenv]
commands =
pytest {posargs: tests}
```
```
============================================= FAILURES ================================
_____________________________________________ test ____________________________________
def test():
> _DIGIT_BOUNDARY_RE.split("10.0.0")
E ValueError: split() requires a non-empty pattern match.
tests/test_god.py:9: ValueError
============================================ short test summary info ==================
...
============================================ test session starts ======================
platform linux -- Python 3.7.5, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
rootdir: /home/probinson/code
collected 1 item
tests/test_re.py . [100%]
============================================ 1 passed in 0.00s =========================
____________________________________________ summary ___________________________________
py27: commands succeeded
ERROR: py36: commands failed
py37: commands succeeded
```
|