Skip to content

Commit 59228c7

Browse files
committed
Run tests directly when testing the system-installed version of asyncpg
1 parent b794061 commit 59228c7

File tree

5 files changed

+22
-3
lines changed

5 files changed

+22
-3
lines changed

.ci/build-manylinux-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ PYTHON="/opt/python/${PYTHON_VERSION}/bin/python"
2525
PIP="/opt/python/${PYTHON_VERSION}/bin/pip"
2626
${PIP} install ${PYMODULE} --no-index -f file:///io/dist
2727
rm -rf /io/tests/__pycache__
28-
make -C /io/ PYTHON="${PYTHON}" test
28+
make -C /io/ PYTHON="${PYTHON}" testinstalled
2929
rm -rf /io/tests/__pycache__

.ci/travis-build-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ elif [ "${TRAVIS_OS_NAME}" == "osx" ]; then
6161

6262
pip install ${PYMODULE} --no-index -f "file:///${_root}/dist"
6363
pushd / >/dev/null
64-
make -C "${_root}" test
64+
make -C "${_root}" testinstalled
6565
popd >/dev/null
6666

6767
_upload_wheels

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ test:
3333
USE_UVLOOP=1 $(PYTHON) setup.py test
3434

3535

36+
testinstalled:
37+
$(PYTHON) tests/__init__.py
38+
USE_UVLOOP=1 $(PYTHON) tests/__init__.py
39+
40+
3641
quicktest:
3742
$(PYTHON) setup.py test
3843

tests/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
# Copyright (C) 2016-present the asyncpg authors and contributors
2+
# <see AUTHORS file>
3+
#
4+
# This module is part of asyncpg and is released under
5+
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
6+
7+
8+
import sys
19
import unittest
210

311

412
def suite():
513
test_loader = unittest.TestLoader()
614
test_suite = test_loader.discover('.', pattern='test_*.py')
715
return test_suite
16+
17+
18+
if __name__ == '__main__':
19+
runner = unittest.runner.TextTestRunner()
20+
result = runner.run(suite())
21+
sys.exit(not result.wasSuccessful())

tests/test_connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ async def test_connection_ssl_unix(self):
516516
async def test_connection_implicit_host(self):
517517
conn_spec = self.cluster.get_connection_spec()
518518
con = await asyncpg.connect(
519-
port=conn_spec['port'], database='postgres', loop=self.loop)
519+
port=conn_spec.get('port'), database='postgres', loop=self.loop)
520520
await con.close()
521521

522522

0 commit comments

Comments
 (0)