File tree Expand file tree Collapse file tree 4 files changed +32
-9
lines changed Expand file tree Collapse file tree 4 files changed +32
-9
lines changed Original file line number Diff line number Diff line change 1+ dist
2+ env
3+ venv
4+ * .egg-info
Original file line number Diff line number Diff line change @@ -42,15 +42,17 @@ time coverage run -a tests/test_simple.py
4242
4343
4444# run tests (PG_BIN)
45- export PG_BIN=$( dirname $( which pg_config) )
46- time coverage run -a tests/test_simple.py
47- unset PG_BIN
45+ time \
46+ PG_BIN=$( dirname $( which pg_config) ) \
47+ ALT_CONFIG=1 \
48+ coverage run -a tests/test_simple.py
4849
4950
5051# run tests (PG_CONFIG)
51- export PG_CONFIG=$( which pg_config)
52- time coverage run -a tests/test_simple.py
53- unset PG_CONFIG
52+ time \
53+ PG_CONFIG=$( which pg_config) \
54+ ALT_CONFIG=1 \
55+ coverage run -a tests/test_simple.py
5456
5557
5658# show coverage
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export PG_BIN=/path/to/pg/bin
2121
2222``` bash
2323# Set path to PostgreSQL and python version
24- export PATH=$PATH : /path/to/pg/bin
24+ export PATH=/path/to/pg/bin: $PATH
2525export PYTHON_VERSION=3 # or 2
2626
2727# Run tests
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def removing(f):
6969 os .remove (f )
7070
7171
72- class SimpleTest (unittest .TestCase ):
72+ class TestgresTests (unittest .TestCase ):
7373 def test_custom_init (self ):
7474 with get_new_node () as node :
7575 # enable page checksums
@@ -757,4 +757,21 @@ def test_child_pids(self):
757757
758758
759759if __name__ == '__main__' :
760- unittest .main ()
760+ if os .environ .get ('ALT_CONFIG' ):
761+ suite = unittest .TestSuite ()
762+
763+ # Small subset of tests for alternative configs (PG_BIN or PG_CONFIG)
764+ suite .addTest (TestgresTests ('test_pg_config' ))
765+ suite .addTest (TestgresTests ('test_pg_ctl' ))
766+ suite .addTest (TestgresTests ('test_psql' ))
767+ suite .addTest (TestgresTests ('test_replicate' ))
768+
769+ print ('Running tests for alternative config:' )
770+ for t in suite :
771+ print (t )
772+ print ()
773+
774+ runner = unittest .TextTestRunner ()
775+ runner .run (suite )
776+ else :
777+ unittest .main ()
You can’t perform that action at this time.
0 commit comments