Patch #1540470, for OpenBSD 4.0.  Backport candidate for 2.[34].
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py
index aeaa77e..2047a63 100644
--- a/Lib/test/test_tempfile.py
+++ b/Lib/test/test_tempfile.py
@@ -27,7 +27,7 @@
 # number of files that can be opened at one time (see ulimit -n)
 if sys.platform == 'mac':
     TEST_FILES = 32
-elif sys.platform == 'openbsd3':
+elif sys.platform in ('openbsd3', 'openbsd4'):
     TEST_FILES = 48
 else:
     TEST_FILES = 100