def test_ignore_spaces(): with pytest.raises(ValueError): ignore_spaces("") p = re.compile(ignore_spaces(" a b")) assert p.match(" a b") assert p.match(" a b") assert p.match(" a b ") assert p.match(" a b ") assert p.match(" a b\n") assert p.match(" a b\n") assert not p.match(" ab") assert not p.match("c b")
'_static/css/jupman.css', '_static/js/toc.js', '_static/js/pytutor-embed.bundle.min.js',] jm.chapter_patterns = ['*/'] jm.chapter_exclude_patterns = ['[^_]*/','exams/', 'project/','file_samples/', 'material/','docs/','img/'] # words used in ipynb files - you might want to translate these in your language. Use plural. jm.ipynb_solutions = "SOLUTIONS" jm.ipynb_exercises = "EXERCISES" #NOTE: the following string is not just a translation, it's also a command that when building the exercises # removes the content after it in the Python cell it is contained in # If the user inserts extra spaces the phrase will be recognized anyway jm.write_solution_here = jmt.ignore_spaces("# write here", must_begin=False) #NOTE: the following string is not just a translation, it's also a command that when building the exercises completely removes the content of the python cell it is contained in (solution comment included). If the user inserts extra spaces the phrase will be recognized anyway jm.solution = jmt.ignore_spaces("# SOLUTION") #NOTE: the following string is not just a translation, it's also a command that # when building the exercises removes the content after it in the markdown cell # it is contained in jm.markdown_answer = jmt.ignore_spaces('**ANSWER**:') ################################################################# jm.zip_ignored = ['__pycache__', '**.ipynb_checkpoints', '.pyc', '.cache', '.pytest_cache', '.vscode'] jm.formats = ["html", "epub", "latex"]