Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit daf6212

Browse files
authored
Merge pull request #1 from funbringer/clean_python_tests
Improve tests based on testgres
2 parents 3a90ceb + 640aeb3 commit daf6212

File tree

7 files changed

+319
-208
lines changed

7 files changed

+319
-208
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ bin/setup.sh
55

66
*.pyc
77
__pycache__
8+
9+
env/
10+
venv/

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,9 @@ include $(top_builddir)/src/Makefile.global
5656
include $(top_srcdir)/contrib/contrib-global.mk
5757
endif
5858

59+
PYTHON = python3
5960
python_tests:
60-
$(MAKE) -C tests/python
61+
$(MAKE) -C tests/python PYTHON=$(PYTHON)
62+
63+
# Special rule for PostgresPro
64+
testgres_check: python_tests

tests/python/.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
ignore = E501
3+
exclude = __pycache__

tests/python/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
logs/

tests/python/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# we need to cd into dir with tests.py, otherwise unittest won't find it
2-
# dir containing this makefile
3-
mkfile_dir := $(shell dirname $(shell readlink -f $(abspath $(lastword $(MAKEFILE_LIST)))))
1+
# User should be able to override PYTHON
2+
PYTHON = python3
43

54
all:
6-
cd $(mkfile_dir) && python3 tests.py
5+
$(PYTHON) tests.py

tests/python/make_pretty.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
DIR=$(dirname $0)
4+
5+
yapf -i "$DIR"/*.py
6+
flake8 "$DIR"

0 commit comments

Comments
 (0)