Commit graph

35 commits

Author SHA1 Message Date
wisp3rwind
2c68349314 pipeline: remove old tests, integrate with out test suite
These have probably not been run by anyone in ages, better to move the
code to our test suite where it is regularly exercised. In fact, the
latter covers most of the cases already. The only missing tests seem to
be those were exceptions are raised in the first or last stage. Thus,
this adds such tests.
2025-05-06 14:51:20 +02:00
Šarūnas Nejus
f36bc497c8
Fix lint issues
- Fix imports
- Fix pytest issues
- Do not assign lambda as variable
- Use isinstance instead of type to check type
- Rename ambiguously named variables
- Name custom errors with Error suffix
2024-09-21 11:59:18 +01:00
Šarūnas Nejus
85a17ee503
Reformat the codebase 2024-09-21 11:57:48 +01:00
Šarūnas Nejus
847e3858a6
Replace assertRaises 2024-08-12 08:43:42 +01:00
Šarūnas Nejus
9a05d27acf
Replace assertEqual 2024-08-12 08:43:42 +01:00
Šarūnas Nejus
fcff5d72af
Remove def suite TestLoader definitions 2024-07-28 18:58:51 +01:00
Serene-Arc
a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Andrew Rogl
1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Adrian Sampson
f545cd3830
Remove unused import 2021-08-19 17:02:28 -04:00
Adrian Sampson
75c41c0546
Remove most six.PY2 checks 2021-08-19 16:45:11 -04:00
Carl Suster
10d41a1cbb tests: avoid non-test classes named Test*
When using pytest's test collector, any class with a name starting with
Test is collected. If it notices that the class has an `__init__` member
then it skips it with a warning since it's probably a false positive.
This isn't a big deal, but we can avoid warnings like this:

    test/test_ui_importer.py:33
      beets/test/test_ui_importer.py:33: PytestCollectionWarning: cannot collect test class 'TestTerminalImportSession' because it has a __init__ constructor
        class TestTerminalImportSession(TerminalImportSession):

simply by renaming TestX to XFixture.
2019-06-02 16:35:37 +10:00
Adrian Sampson
a88682e7bb Undo from _common import unittest indirection
This was a vestige from when we used to need the unittest2 library for pre-2.7
compatibility. Now that we require Python 2.7, we aren't using that library
and this indirection wasn't doing any good.
2016-11-26 18:46:44 -05:00
wordofglass
ebf44fd6cd Workaround for a race condition on queue invalidation, Issue #2078 2016-06-29 18:22:44 +02:00
Johnny Robeson
433ac368df check pull.__next__ on py3 in pipeline tests 2016-06-24 05:53:56 -04:00
Johnny Robeson
6849ab874e skip pipeline test_constrainted_exception on PY3
This one would make every test run last until the timeout is reached, so
it's necessary skip it until the root cause is found.
2016-06-24 05:53:56 -04:00
Adrian Sampson
71b9fd785c Revert "Do __name__ comparison with bytes and not unicode"
This reverts commit 9c41c39913.
That commit used byte strings for the `if __name__ == '__main__'` pattern,
which was necessary when we were doing unicode_literals. But it is wrong on
Python 3, and now that we're liberated from unicode_literals, we need to go
back to native strings for this comparison.
2016-05-29 19:19:59 -07:00
Johnny Robeson
b99a6acc54 use next() instead of iter.next() throughout 2016-05-27 17:00:40 -04:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Peter Kessen
945c4e201d Removed unicode_literals form test_pipeline 2016-02-24 07:36:23 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Bruno Cauet
53c21330c2 All tests use unicode_literals 2015-01-20 15:58:02 +01:00
Bruno Cauet
9c41c39913 Do __name__ comparison with bytes and not unicode 2015-01-20 12:03:57 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Bruno Cauet
2902cda036 tests: use absolute imports everywhere 2015-01-19 12:25:15 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Thomas Scholtes
495c49703c Add pipeline.mutator_stage 2014-04-19 19:04:49 +02:00
Thomas Scholtes
d8362fd03c Add pipeline.stage decorator 2014-04-19 18:54:29 +02:00
Thomas Scholtes
a6aed22ddd Flake8 fixes 2014-04-17 12:25:59 +02:00
Thomas Scholtes
565a284c03 Add pull() generator to Pipeline 2014-02-01 13:43:05 +01:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
b68e87b92c The Great Trailing Whitespace Purge of 2012
What can I say? I used to use TextMate!
2012-05-13 20:22:17 -07:00
Adrian Sampson
5a0105b12c fall back to unittest2 (#275) 2012-01-31 15:25:09 -08:00
Adrian Sampson
828f1aa4f1 multiple() function for sending many messages to next stage 2011-04-17 08:18:54 -07:00
Adrian Sampson
85cd3cdb84 add pipeline tests, fixing a bug with parallel stages in the process 2011-04-17 07:57:56 -07:00