From 41d503b352da1fee81d43d2dadf65b4d91ebd9cc Mon Sep 17 00:00:00 2001
From: Tom Keffer
Date: Sat, 16 Jan 2016 16:35:49 -0800
Subject: [PATCH] Modified test suite to get it to work with Python 2.6.
Dropped support of Python 2.5
---
bin/weedb/test/test_weedb.py | 12 +++++-------
docs/changes.txt | 3 +++
docs/setup.htm | 2 +-
docs/usersguide.htm | 13 +++++++------
4 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/bin/weedb/test/test_weedb.py b/bin/weedb/test/test_weedb.py
index 5e7211be..83e726aa 100644
--- a/bin/weedb/test/test_weedb.py
+++ b/bin/weedb/test/test_weedb.py
@@ -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")
diff --git a/docs/changes.txt b/docs/changes.txt
index c9d20bbf..378df2e3 100644
--- a/docs/changes.txt
+++ b/docs/changes.txt
@@ -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!
diff --git a/docs/setup.htm b/docs/setup.htm
index 7a0f327f..a8d36e57 100644
--- a/docs/setup.htm
+++ b/docs/setup.htm
@@ -109,7 +109,7 @@
Install Prerequisites
-Ensure that Python2 is installed. Python 2.5, 2.6, or 2.7 will work,
+
Ensure that Python2 is installed. Python 2.6 or 2.7 will work,
but Python 3 will not.
python -V
Then install required python packages using the package management
diff --git a/docs/usersguide.htm b/docs/usersguide.htm
index c7b5e4ba..6bb8c524 100644
--- a/docs/usersguide.htm
+++ b/docs/usersguide.htm
@@ -852,7 +852,7 @@ Version: 3.3.1
I run weewx 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.
Weewx also runs great on a Raspberry Pi, although report generation will take longer.
@@ -874,7 +874,8 @@ Version: 3.3.1
Python
- Python 2.5, 2.6, or 2.7 is required. Python 3 will not work.
+ Python 2.6 or 2.7 is required. Python 2.5 may work with some fiddling,
+ but has not been tested. Python 3 definitely will not work.
Installing weewx
@@ -5102,11 +5103,11 @@ Dec 31 17:01:06 arm weewx[18141]: **** Exiting.
--fix to have the utility fix them:
wee_database weewx.conf --string-check --fix
- Python 2.5
+ Python 2.5
- 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
+
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.
+ You may have to install pysqlite and PIL. Here is
how to do it with
easy_install, but you may be
able to use apt-get or other tools, depending on