summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace normalization.Tim Peters2005-01-131-7/+7
|
* Add strptime() constructor to datetime class. Thanks to Josh Spoerri forSkip Montanaro2005-01-131-0/+9
| | | | the changes.
* Add counting of source iterator lines to the reader object - handy forAndrew McNamara2005-01-121-1/+13
| | | | | user error messages (otherwise difficult to do without instrumenting the source).
* When quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fieldsAndrew McNamara2005-01-121-0/+6
| | | | to floats.
* Fix logic problem in quoting=csv.QUOTE_ALL, quotechar=None check, add test.Andrew McNamara2005-01-121-0/+2
|
* When using QUOTE_NONNUMERIC, we now test for "numericness" withAndrew McNamara2005-01-121-10/+20
| | | | | | | | PyNumber_Check, rather than trying to convert to a float. Reimplemented writer - now raises exceptions when it sees a quotechar but neither doublequote or escapechar are set. Doublequote results are now more consistent (eg, single quote should generate """", rather than "", which is ambiguous).
* Rename csv.set_field_limit to csv.field_size_limit (since it both sets andAndrew McNamara2005-01-121-7/+7
| | | | gets).
* Improve test coverage fractionally.Andrew McNamara2005-01-121-9/+23
|
* Set an upper limit on the size of the field buffer, raise an exceptionAndrew McNamara2005-01-111-2/+9
| | | | | | | when this limit is reached. Limit defaults to 128k, and is changed by module set_field_limit() method. Previously, an unmatched quote character could result in the entire file being read into the field buffer, potentially exhausting virtual memory.
* SF 1098985: set objects cannot be marshalledRaymond Hettinger2005-01-111-0/+12
|
* Replace python-coded validation of csv dialect with a call to the CAndrew McNamara2005-01-111-4/+0
| | | | dialect type (which has a better idea of what is and isn't valid).
* No longer attempt to instantiate python classes describing dialects. ThisAndrew McNamara2005-01-111-18/+0
| | | | | | was done because we were previously performing validation of the dialect from python, but this is now down within the C module. Also, the method we were using to detect classes did not work with new-style classes.
* Allow dialect-describing keywords to be supplied to register_dialect,Andrew McNamara2005-01-111-1/+10
| | | | | record objects of internal dialect type, rather than instances of python objects.
* Fix and test for SF bug #1098990: codec readline() splits lines apart.Walter Dörwald2005-01-101-0/+30
|
* Fix parsing of csv files with escapes (escape character previously would beAndrew McNamara2005-01-101-2/+2
| | | | left in stream).
* Patch #712317: In URLs such as http://www.example.com?query=spam, treat '?' asJohannes Gijsbers2005-01-091-28/+51
| | | | | | a delimiter. Previously, the 'network location' (<authority> in RFC 2396) would become 'www.example.com?query=spam', while RFC 2396 does not allow a '?' in <authority>. See bug #548176 for further discussion.
* Clean up tests by reusing functions from other modules:Johannes Gijsbers2005-01-081-31/+8
| | | | | | * replace deltree with shutil.rmtree() * replace mkdirs with os.makedirs() * fold touchfile into GlobTests.mktemp()
* Patch #943206:Johannes Gijsbers2005-01-081-1/+3
| | | | | | | | | | | | | | | | `glob.glob()` currently calls itself recursively to build a list of matches of the dirname part of the pattern and then filters by the basename part. This is effectively BFS. ``glob.glob('*/*/*/*/*/foo')`` will build a huge list of all directories 5 levels deep even if only a handful of them contain a ``foo`` entry. A generator-based recusion would never have to store these list at once by implementing DFS. This patch converts the `glob` function to an `iglob` recursive generator . `glob()` now just returns ``list(iglob(pattern))``. I also cleaned up the code a bit (reduced duplicate `has_magic()` checks and created a second `glob0` helper func so that the main loop need not be duplicated). Thanks to Cherniavsky Beni for the patch!
* threading._DummyThread.__init__(): document obscure new code.Tim Peters2005-01-081-1/+22
| | | | | | | | test_threading.test_foreign_thread(): new test does a basic check that "foreign" threads can using the threading module, and that they create a _DummyThread instance in at least one use case. This isn't a very good test, since a thread created by thread.start_new_thread() isn't particularly "foreign".
* Converted to a unittest. Added checks that the bounded semaphore actuallyTim Peters2005-01-081-37/+73
| | | | does what it's supposed to do.
* Remove test for BINARY_DIVIDE.Raymond Hettinger2005-01-071-1/+0
|
* Whitespace normalization.Tim Peters2005-01-074-32/+31
|
* Improved the implementation of the internal "dialect" type. The newAndrew McNamara2005-01-071-24/+99
| | | | | implementation features better error reporting, and better compliance with the PEP.
* Teach the peephole optimizer to fold simple constant expressions.Raymond Hettinger2005-01-021-0/+28
|
* New subprocess utility function: check_call. Closes #1071764.Peter Astrand2005-01-011-0/+16
|
* Add a test that checks the basic functionality of every encoding.Walter Dörwald2004-12-291-1/+179
|
* [Bug #1083110] calling .flush() on decompress objects causes a segfault due ↵Andrew M. Kuchling2004-12-281-0/+10
| | | | to an uninitialized pointer: fixes the problem and adds a test case
* Dima Dorfman's patch for coercion/comparison of C types (patch #995939), withArmin Rigo2004-12-231-0/+36
| | | | | a minor change after the coercion, to accept two objects not necessarily of the same type but with the same tp_compare.
* add __file__ to the globals available for tests loaded via DocFileSuite;Fred Drake2004-12-212-0/+13
| | | | | this is useful for locating supporting data files, just as it is in Python modules
* The changes to the stateful codecs in 2.4 resulted in StreamReader.readline()Walter Dörwald2004-12-211-13/+80
| | | | | | | | | | | | | | trying to return a complete line even if a size parameter was given (see http://www.python.org/sf/1076985). This leads to buffer overflows with long source lines under Windows if e.g. cp1252 is used as the source encoding. This patch reverts the behaviour of readline() to something that behaves more like Python 2.3: If a size parameter is given, read() is called only once. As a side effect of this, readline() now supports all types of linebreaks supported by unicode.splitlines(). Note that the tokenizer is still broken and it's possible to provoke segfaults (see http://www.python.org/sf/1089395).
* Any call to marshal.dumps() with the new optional argument 'version' justArmin Rigo2004-12-201-0/+5
| | | | | immediately segfaults, due to a typo! This was obviously never tested... Added a test for it, and also fixed the documentation.
* Skip test_imp if threading is not available.Brett Cannon2004-12-181-1/+5
| | | | Closes bug #1083645. Thanks Detlef Vollmann.
* Bug #1083645Raymond Hettinger2004-12-181-2/+12
| | | | * The decimal module wouldn't load on builds without threads.
* SF #1085304: Make array.array pickle-ableRaymond Hettinger2004-12-161-0/+19
|
* Fix copy & paste error in comments.Walter Dörwald2004-12-141-2/+2
|
* Patch #1011890: fix inspect.getsource breaking with line-continuation &Johannes Gijsbers2004-12-122-1/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | more. Thanks to Simon Percivall! The patch makes changes to inspect.py in two places: * the pattern to match against functions at line 436 is modified: lambdas should be matched even if not preceded by whitespace, as long as "lambda" isn't part of another word. * the BlockFinder class is heavily modified. Changes are: - checking for "def", "class" or "lambda" names before setting self.started to True. Then checking the same line for word characters after the colon (if the colon is on that line). If so, and the line does not end with a line continuation marker, raise EndOfBlock immediately. - adding self.passline to show that the line is to be included and no more checking is necessary on that line. Since a NEWLINE token is not generated when a line continuation marker exists, this allows getsource to continue with these functions even if the following line would not be indented. Also add a bunch of 'quite-unlikely-to-occur-in-real-life-but-working-anyway' tests.
* Patch #736962: port test_inspect to unittest. As part of this, move outJohannes Gijsbers2004-12-123-395/+427
| | | | | the fodder modules to separate files to get rid of the imp.load_source() trickery.
* Use os.geteuid() for checking whether we are root, as suggested byJohannes Gijsbers2004-12-121-1/+1
| | | | Michael Hudson.
* Whitespace normalization.Tim Peters2004-12-071-13/+13
|
* SF bug #1076467: don't run test_on_error as root, as the permissionJohannes Gijsbers2004-12-061-2/+6
| | | | | errors don't get provoked that way. Also add a bunch of cross-references to bugs.
* Have test_mkalias_relative check that sys.prefix already exists; otherwise testBrett Cannon2004-12-061-0/+6
| | | | | | | | | | is pointless. Also add a note to the docs for the 'test' package that test cases should check first that any conditions needed in the operating system are met before having a test run. Closes bug #1077302. THanks, Ian Holsman.
* Removed deprecated tzparse module.Raymond Hettinger2004-12-051-1/+0
|
* Added optional None arguments to itertools.islice().Raymond Hettinger2004-12-051-0/+2
|
* Remove the deprecated statcache module.Raymond Hettinger2004-12-052-6/+0
|
* Removed deprecated method arguments from the shelve module.Raymond Hettinger2004-12-051-8/+8
|
* SF patch #1077353: add key= argument to min and maxRaymond Hettinger2004-12-031-4/+75
| | | | (First draft of patch contributed by Steven Bethard.)
* Add key= argument to heapq.nsmallest() and heapq.nlargest().Raymond Hettinger2004-12-021-1/+7
|
* Raise TypeError if bufsize argument is not an integer. Patch 1071755, ↵Peter Astrand2004-11-301-0/+11
| | | | slightly modified.
* Fix argument order in pure python version of nsmallest() and nlargest().Raymond Hettinger2004-11-291-2/+5
|
* SF bug #1071588 coercing decimal to int doesn't work between -1 and 1Raymond Hettinger2004-11-241-4/+4
|