Commit 189d7728 authored by Marius Gedminas's avatar Marius Gedminas

Add a failing test

The test fails on Python 3 only, and on non-pure builds only.  I added
PYTHONFAULTHANDLER=1 to the environment to make the failure less
mysteriously silent.

I've also updated tox.ini to use extras=foo instead of deps=.[foo] and
to use factors to set PURE_PYTHON=1 instead of defining an entire
environment.  This now lets you run arbitrary pure Python builds like
tox -e py37-pure.
parent 7e205796
...@@ -72,5 +72,18 @@ class TestBTreesUnicode(unittest.TestCase): ...@@ -72,5 +72,18 @@ class TestBTreesUnicode(unittest.TestCase):
self.assertTrue(isinstance(k, str)) self.assertTrue(isinstance(k, str))
self.assertEqual(self.tree[k], v) self.assertEqual(self.tree[k], v)
class TestBTreeBucketUnicode(unittest.TestCase):
def testUnicodeRepr(self):
# Regression test for
# https://github.com/zopefoundation/BTrees/issues/106
items = [(1, u'\uaabb')]
from BTrees.OOBTree import OOBucket
bucket = OOBucket(items)
self.assertEqual(repr(bucket),
'BTrees.OOBTree.OOBucket(%s)' % repr(items))
def test_suite(): def test_suite():
return unittest.makeSuite(TestBTreesUnicode) return unittest.defaultTestLoader.loadTestsFromName(__name__)
...@@ -7,22 +7,13 @@ envlist = ...@@ -7,22 +7,13 @@ envlist =
[testenv] [testenv]
usedevelop = true usedevelop = true
deps = extras =
.[test] test
commands = commands =
zope-testrunner --test-path=. --auto-color --auto-progress [] zope-testrunner --test-path=. --auto-color --auto-progress []
[testenv:py27-pure]
basepython =
python2.7
setenv = setenv =
PURE_PYTHON = 1 PYTHONFAULTHANDLER=1
pure: PURE_PYTHON=1
[testenv:py35-pure]
basepython =
python3.5
setenv =
PURE_PYTHON = 1
#[testenv:jython] #[testenv:jython]
#commands = #commands =
...@@ -32,7 +23,6 @@ setenv = ...@@ -32,7 +23,6 @@ setenv =
basepython = basepython =
python2.7 python2.7
deps = deps =
{[testenv]deps}
ZODB ZODB
[testenv:coverage] [testenv:coverage]
...@@ -42,7 +32,6 @@ commands = ...@@ -42,7 +32,6 @@ commands =
coverage run -m zope.testrunner --test-path=. --auto-color --auto-progress [] coverage run -m zope.testrunner --test-path=. --auto-color --auto-progress []
coverage report --fail-under=92 coverage report --fail-under=92
deps = deps =
{[testenv]deps}
coverage coverage
[testenv:docs] [testenv:docs]
...@@ -51,5 +40,5 @@ basepython = ...@@ -51,5 +40,5 @@ basepython =
commands = commands =
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest sphinx-build -b doctest -d docs/_build/doctrees docs docs/_build/doctest
deps = extras =
.[docs] docs
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment