Skip to content

xDeaRxDeViLx/anki_testing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Easy testing of Anki add-ons

A small utility for testing Anki 2.1 add-ons. The code from this repository is used by Anki-Night-Mode and AwesomeTTS.

Usage

  1. (Optional) add following to you .gitignore:
anki_root
anki_testing
  1. Clone this repository into the root of your add-on repo:
git clone https://github.com/krassowski/anki_testing
  1. In your tests add:
from anki_testing import anki_running

def test_my_addon():
    with anki_running() as anki_app:
        import my_addon
        # add some tests in here
  1. Create a testing script which will install Anki and then call your test-runner. For example:
#!/usr/bin/env bash
bash anki_testing/install_anki.sh
python3 -m pytest tests

Lets call the file above run_tests.sh.

  1. (Optional) configure .travis.yml using following template:
language: python
sudo: required

python:
  - 3.6

install: 
  - git clone https://github.com/krassowski/anki_testing
  - source anki_testing/setup.sh 

script:
  - bash run_tests.sh

Releases

No releases published

Packages

No packages published

Languages

  • Python 73.7%
  • Shell 26.3%