Commit graph

26 commits

Author SHA1 Message Date
PIG208 fba21bb00d black: Reformat skipping string normalization. 2021-06-02 18:45:57 -07:00
PIG208 5580c68ae5 isort: Reformat using isort. 2021-06-02 18:45:57 -07:00
Anders Kaseorg 2f6623bbc4 cleanup: Remove unused imports.
Generated by autoflake.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-18 20:31:14 -07:00
Marco Burstein d176fbe324 bots: Fix a Chessbot dependency error.
Specify a version for Chessbot so that it will continue to function
properly if the library is updated. Also, update `test-bots` to remove
a temporary fix for Chessbot.
2018-12-09 18:57:10 -08:00
Steve Howell b4d0a2463e Temporarily exclude chessbot bot from tests. 2018-12-09 11:16:30 -08:00
neiljp (Neil Pilgrim) 4e0dccc9f5 test-bots: Make bots_to_test a set, ensuring tests are not duplicated.
The previous style was causing duplicate tests for the dropbox_share bot
for the unittest runner, due to globbing of test_*.py giving duplicates.

However, it also avoids unintentional duplication of bot names to test
on the command line being tested multiple times, though again only with
the unittest runner.
2018-06-28 14:55:23 -04:00
neiljp (Neil Pilgrim) d73fa0f50f test-bots: Add option to use pytest for running tests.
* Add pytest to requirements.txt
* Add pass-through option to run pytest in verbose mode
* Use various default pytest options
* Exclude merels bot for now
2018-06-09 14:13:18 -04:00
neiljp (Neil Pilgrim) 6cdb83ce72 bot tests: Adjust TestCase inheritance to avoid need to skip/filter.
Previously the test-bots script filtered out base-class tests from
BotTestCase. With this change, BotTestCase continues to inherit from
unittest.TestCase, but the default test_* methods previously in this
class are now in a new DefaultTests class, which does not. Instead, each
bot needs to inherit from BotTestCase and DefaultTests *explicitly*.

This avoids the need to filter out the base-class tests, which
simplifies the test-bots script, and may ease any migration to eg.
pytest.

The DefaultTests class does require some non-implemented methods which
BotTestCase provides.
2018-06-09 12:49:49 -04:00
neiljp (Neil Pilgrim) a178f93087 test-bots: Detect absent __init__.py & optionally exit. 2018-05-26 17:28:25 -07:00
neiljp (Neil Pilgrim) bda678344f test-bots: Extract common filter out of conditional. 2018-05-26 17:28:25 -07:00
neiljp (Neil Pilgrim) 210caa4a60 test-bots: Extract test discovery out of conditional.
This (re?)-enables exclusion of bot names from eg. `test-bots`.
2018-05-26 17:22:03 -07:00
neiljp (Neil Pilgrim) a5307b3771 test-bots: Use unused available_bots to discover tests. 2018-05-26 17:22:03 -07:00
neiljp (Neil Pilgrim) 76b2befb9b test-bots: Remove unused function parameter. 2018-05-26 17:22:03 -07:00
neiljp (Neil Pilgrim) 1d60794f1c test-bots: Simplify and unify test discovery. 2018-05-26 17:21:54 -07:00
Steve Howell 41b065eb76 tools: Fix python -> python3 for bots scripts.
This also turns off the custom lint check that was
preventing an explicit version for scripts in "tools".

Fixes #187
2018-01-02 17:38:12 +01:00
Robert Hönig b306324bfa zulip_bots: Make BotTestCase the only helper library.
Renames StubBotTestCase to BotTestCase and removes
legacy code for supporting both names.
2017-12-14 05:56:55 -05:00
Steve Howell fc251460fa bot tests: Eliminate BotTestCaseBase.
We now just put `test_bot_usage` in StubBotTestCase and have
BotTestCase inherit from that.
2017-12-01 07:00:20 -08:00
Steve Howell 205f7c16c7 Add StubBotTestCase and StubBotHandler.
We will start to use these for some of our bot test code.
2017-12-01 07:00:20 -08:00
derAnfaenger 9c37f92a01 zulip_bots: Add common tests.
unittest includes by default all module-level classes that inherit
from TestCase and implement at least one method starting with 'test'.
Since it doesn't provide a convenient way for excluding TestSuites,
we need to manually filter out the unwanted testing of our test base
class itself.
2017-11-14 09:39:00 -08:00
derAnfaenger 095cea7ab9 codecov: Document line capture issue in code. 2017-08-22 11:42:57 +02:00
derAnfaenger a5708e4dde testing: Add code test coverage reporting.
Fixes #38.
2017-08-21 15:03:47 -07:00
Eeshan Garg c61d413f25 zulip_bots: Remove thesaurus bot.
This bot depends on PyDictionary, which isn't very well-implemented
or well-maintained. PyDictionary's dependency on goslate and
goslate's dependency on concurrent.futures has been known to cause
problems in Python 3 virtualenvs. This bot has also been the
source of disruptive BeautifulSoup warnings. Since this bot is only
meant to be an example bot, and for all the above reasons,
it makes sense to remove this bot. The cons of debugging the above
issues outweight the pros of having the bot at all.
2017-08-16 16:54:24 -07:00
derAnfaenger f0e00ce971 bot tests: Make test-bots fail with proper exit code.
Fixes #45.
2017-08-15 10:46:07 -07:00
Eeshan Garg d181d0192e zulip_bots: Use relative paths to find zulip_bots/bots/*. 2017-07-25 10:50:33 -07:00
Eeshan Garg 472c869efa test-bots: Load and discover unit tests from specific modules.
Instead of discovering unit tests using loader.discover() by passing
it a set of starting and top level directories, we now discover
unit tests by loading them from specific test module objects. This
makes it easier to include and exclude specific bots from testing.
2017-07-25 10:50:33 -07:00
Eeshan Garg 879f44ab3a bots: Move all bots and the bots API to separate package. 2017-07-18 02:20:27 -02:30
Renamed from bots_api/test-bots (Browse further)