Modified test suite to get it to work with Python 2.6.

Dropped support of Python 2.5
This commit is contained in:
Tom Keffer
2016-01-16 16:35:49 -08:00
parent 7f8384ef6c
commit 41d503b352
4 changed files with 16 additions and 14 deletions

View File

@@ -73,7 +73,7 @@ class Common(unittest.TestCase):
def test_create(self):
self.populate_db()
_connect = weedb.connect(self.db_dict)
self.assertItemsEqual(_connect.tables(), ['test1', 'test2'])
self.assertEqual(sorted(_connect.tables()), ['test1', 'test2'])
self.assertEqual(_connect.columnsOf('test1'), ['dateTime', 'min', 'mintime', 'max', 'maxtime', 'sum', 'count', 'descript'])
self.assertEqual(_connect.columnsOf('test2'), ['dateTime', 'min', 'mintime', 'max', 'maxtime', 'sum', 'count', 'descript'])
for icol, col in enumerate(_connect.genSchemaOf('test1')):
@@ -125,12 +125,10 @@ class Common(unittest.TestCase):
_cursor = _connect.cursor()
# Test SELECT on a bad table name
with self.assertRaises(weedb.ProgrammingError):
_cursor.execute("SELECT dateTime, min FROM foo")
self.assertRaises(weedb.ProgrammingError, _cursor.execute, "SELECT dateTime, min FROM foo")
# Test SELECT on a bad column name
with self.assertRaises(weedb.OperationalError):
_cursor.execute("SELECT dateTime, foo FROM test1")
self.assertRaises(weedb.OperationalError, _cursor.execute, "SELECT dateTime, foo FROM test1")
_cursor.close()
_connect.close()
@@ -158,7 +156,7 @@ class Common(unittest.TestCase):
_row = _cursor.fetchone()
_cursor.close()
_connect.close()
self.assertIsNone(_row, msg="Rollback")
self.assertEqual(_row, None, msg="Rollback")
def test_transaction(self):
# Create the database and schema
@@ -187,7 +185,7 @@ class Common(unittest.TestCase):
_row = _cursor.fetchone()
_cursor.close()
_connect.close()
self.assertIsNone(_row, msg="Transaction")
self.assertEqual(_row, None, msg="Transaction")

View File

@@ -3,6 +3,9 @@ weewx change history
X.X.X XX/XX/XX
Python 2.5 is no longer supported. You may be able to get it to work, but it
is no longer tested.
The tag $hour has now been added. It's now possible to iterate over hours.
Thanks to user Julen!

View File

@@ -109,7 +109,7 @@
<h2>Install Prerequisites</h2>
<p>Ensure that Python2 is installed. Python 2.5, 2.6, or 2.7 will work,
<p>Ensure that Python2 is installed. Python 2.6 or 2.7 will work,
but Python 3 will not.</p>
<pre class='tty cmd'>python -V</pre>
<p>Then install required python packages using the package management

View File

@@ -852,7 +852,7 @@ Version: 3.3.1
<p>I run <span class="code">weewx</span> on a Fit-PC with a 500 MHz AMD
Geode processor and 512 MB of memory. Configured this way, it
consumes about 5% of the CPU, 80 MB of virtual memory,
consumes about 5% of the CPU, 100 MB of virtual memory,
and 20 MB of real memory. </p>
<p>Weewx also runs great on a Raspberry Pi, although report generation will take longer.
@@ -874,7 +874,8 @@ Version: 3.3.1
<h2>Python</h2>
<p>Python 2.5, 2.6, or 2.7 is required. Python 3 will not work.</p>
<p>Python 2.6 or 2.7 is required. <a href="#python2_5">Python 2.5</a> may work with some fiddling,
but has not been tested. Python 3 definitely will not work.</p>
<h1 id="installing">Installing <span class="code">weewx</span></h1>
@@ -5102,11 +5103,11 @@ Dec 31 17:01:06 arm weewx[18141]: **** Exiting.</pre>
<span class='code'>--fix</span> to have the utility fix them:</p>
<pre class="tty cmd">wee_database weewx.conf --string-check --fix</pre>
<h3>Python 2.5</h3>
<h3 id="python2_5">Python 2.5</h3>
<p>Weewx should work with Python version 2.5, but it may take some fiddling
to get it to work. Later versions of Python come with pysqlite and
PIL already installed. You may have to do this yourself. Here is
<p>Weewx is no longer tested on Python version 2.5. What follows are some clues on how
to get it to work. You might get lucky.</p>
<p>You may have to install pysqlite and PIL. Here is
how to do it with <a href="https://pypi.python.org/pypi/setuptools#python-2-4-and-python-2-5-support">
<span class='code'>easy_install</span></a>, but you may be
able to use <span class='code'>apt-get</span> or other tools, depending on