summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2018-10-30 16:57:42 -0500
committerptmcg <ptmcg@austin.rr.com>2018-10-30 16:57:42 -0500
commit41bb3b91e2f1e552fc1afa2373e21028035471aa (patch)
tree6ac8572e7cba859d8cd88430b8f839b96aa3bac1
parent6c8840a8553eaef161b7d002c00c76dc61644f0d (diff)
downloadpyparsing-git-41bb3b91e2f1e552fc1afa2373e21028035471aa.tar.gz
Clean up old cruft from unit tests
-rw-r--r--.idea/misc.xml2
-rw-r--r--.idea/pyparsing.iml6
-rw-r--r--unitTests.py32
-rw-r--r--update_pyparsing_timestamp.py7
4 files changed, 11 insertions, 36 deletions
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 18f88b2..5567f4e 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
- <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.6.2 (/usr/bin/python3.6)" project-jdk-type="Python SDK" />
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.5.2 (C:\Python35\python.exe)" project-jdk-type="Python SDK" />
</project> \ No newline at end of file
diff --git a/.idea/pyparsing.iml b/.idea/pyparsing.iml
index 6711606..4d16a16 100644
--- a/.idea/pyparsing.iml
+++ b/.idea/pyparsing.iml
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
- <content url="file://$MODULE_DIR$" />
- <orderEntry type="inheritedJdk" />
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/User_samples" />
+ </content>
+ <orderEntry type="jdk" jdkName="Python 3.5.2 (C:\Python35\python.exe)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
diff --git a/unitTests.py b/unitTests.py
index 83dd08c..184a8ac 100644
--- a/unitTests.py
+++ b/unitTests.py
@@ -8,12 +8,9 @@
#
#
from unittest import TestCase, TestSuite, TextTestRunner
-import unittest
import datetime
-
from pyparsing import ParseException
import pyparsing as pp
-#~ import HTMLTestRunner
import sys
import pdb
@@ -3872,18 +3869,8 @@ def makeTestSuiteTemp(classes):
suite.addTest( cls() )
return suite
-console = False
-console = True
-
-#~ from line_profiler import LineProfiler
-#~ from pyparsing import ParseResults
-#~ lp = LineProfiler(ParseResults.__setitem__)
-lp = None
+if __name__ == '__main__':
-#~ if __name__ == '__main__':
- #~ unittest.main()
-if console:
- #~ # console mode
testRunner = TextTestRunner()
# run specific tests by including them in this list, otherwise
@@ -3895,19 +3882,4 @@ if console:
testRunner.run( makeTestSuite() )
else:
BUFFER_OUTPUT = False
- if lp is None:
- testRunner.run( makeTestSuiteTemp(testclasses) )
- else:
- lp.run("testRunner.run( makeTestSuite(%s) )" % testclass.__name__)
-else:
- # HTML mode
- outfile = "testResults.html"
- outstream = open(outfile,"w")
- testRunner = HTMLTestRunner.HTMLTestRunner( stream=outstream )
- testRunner.run( makeTestSuite() )
- outstream.close()
-
- import os
- os.system(r'"C:\Program Files\Internet Explorer\iexplore.exe" file://' + outfile)
-
-#~ lp.print_stats()
+ testRunner.run(makeTestSuiteTemp(testclasses))
diff --git a/update_pyparsing_timestamp.py b/update_pyparsing_timestamp.py
index 80ea3d4..4a82bd1 100644
--- a/update_pyparsing_timestamp.py
+++ b/update_pyparsing_timestamp.py
@@ -9,9 +9,10 @@ quoted_time = quotedString()
quoted_time.setParseAction(lambda: nowstring)
version_time = "__versionTime__ = " + quoted_time
-with open('pyparsing.py') as oldpp:
- new_code = version_time.transformString(oldpp.read())
+with open('pyparsing.py', encoding='utf-8') as oldpp:
+ orig_code = oldpp.read()
+ new_code = version_time.transformString(orig_code)
-with open('pyparsing.py','w') as newpp:
+with open('pyparsing.py','w', encoding='utf-8') as newpp:
newpp.write(new_code)