diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 index d49ed8d..299aff7 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ -# GNU Make file for the automation of pytest for appendfilename. +# GNU Make file for the automation of pytest for appendfilename # -# While the test script is written for Python 3.9.2, you might need to -# adjust the following instruction once in case your OS includes -# pytest for legacy Python 2 side by side to Python 3, or only hosts -# pytest for Python 3. The tests in script test_appendfilename.py are -# set up to work with pytest for Python 3; dependent on your -# installation, which may be named pytest-3, or (again) pytest. +# While the test script is written for Python 3.9.2, it depends on +# your installation of pytest (and in case of Linux, the authors of +# your distribution) if pytest for Python 3 is invoked either by +# pytest, or pytest-3. In some distributions, pytest actually may +# invoke pyest for legacy Python 2; the tests in test_date2name.py +# however are incompatible to this. # # Put this file like test_appendfilename.py in the root folder of # appendfilename fetched from PyPi or GitHub. Then run @@ -17,5 +17,5 @@ # right after the first test failing, use the -x flag to the # instructions on the CLI in addition to the verbosity flag to (-v). -# pytest -v test_appendfilename.py # only pytest for Python 3 is present -pytest-3 -v test_appendfilename.py # pytest if Python 2 and Python 3 coexist +# pytest -v test_appendfilename.py # the pattern by pytest's manual +pytest-3 -v test_appendfilename.py # the alternative pattern (e.g., Debian 12) diff --git a/test_generator.org b/test_generator.org index 148bb1e..a5931ea 100755 --- a/test_generator.org +++ b/test_generator.org @@ -1,7 +1,7 @@ # name: test_generator.org # author: nbehrnd@yahoo.com # date: 2022-01-05 (YYYY-MM-DD) -# edit: 2022-01-06 (YYYY-MM-DD) +# edit: 2022-01-09 (YYYY-MM-DD) # license: GPL3, 2022. # Export the tangled files with C-c C-v t @@ -22,24 +22,24 @@ * Deployment - On a computer with Python 3 only, the recommended call on the CLI to - run the tests is either one of the following instructions (you might - need to add the executable bit): + The programmatic tests are set up for pytest for Python 3. It + however depends on your installation (and in case of Linux, the + authors of your Linux distribution ([[https://github.com/pytest-dev/pytest/discussions/9481][reference]])) if this utility may + be started by =pytest= (e.g., the pattern in pytest's manual), or by + =pytest-3= by either one of the pattern below: #+begin_src bash :tangle no - python pytest -v test_appendfilename.py - ./Makefile +pytest -v test_appendfilename.py +pytest-3 -v test_appendfilename.py #+end_src - In case the computer you use equally includes an installation of - legacy Python 2 side-by-side to Python 3, you must explicitly call - for the later branch of the two. Depending on your OS, this - requires an adjustment of the command issued. In Linux Debian - 12/bookworm, branch testing, for example, + As of writing, the later pattern is the to be used e.g., in Linux + Debian 12/bookworm (branch testing) to discern pytest (for + contemporary Python 3) from pytest (for legacy Python 2). - #+begin_src bash :tangle no - python3 pytest-3 -v test_appendfilename.py - #+end_src + The =Makefile= this =org= file provides for convenience running + these tests assumes the later syntax pattern. (It might be + necessary to provide the executable bit to activate the Makefile.) * Setup of Emacs @@ -56,38 +56,38 @@ permission. #+begin_src emacs-lisp :tangle no -;; support these languages at all: -(org-babel-do-load-languages - 'org-babel-load-languages - '((emacs-lisp . t) - (org . t) - (shell . t) - (python . t))) + ;; support these languages at all: + (org-babel-do-load-languages + 'org-babel-load-languages + '((emacs-lisp . t) + (org . t) + (shell . t) + (python . t))) -;; enable syntax highlighting: -(setq org-src-fontify-natively t) + ;; enable syntax highlighting: + (setq org-src-fontify-natively t) -;; adjust indentations, set tabs as explicit 4 spaces: -(setq-default indent-tabs-mode nil) -(setq default-tab-width 4) + ;; adjust indentations, set tabs as explicit 4 spaces: + (setq-default indent-tabs-mode nil) + (setq default-tab-width 4) -(setq custom-tab-width 4) -(setq-default python-indent-offset custom-tab-width) + (setq custom-tab-width 4) + (setq-default python-indent-offset custom-tab-width) -(setq org-edit-src-content-indentation 0) -(setq org-src-tab-acts-natively t) -(setq org-src-preserve-indentation t) + (setq org-edit-src-content-indentation 0) + (setq org-src-tab-acts-natively t) + (setq org-src-preserve-indentation t) -;; some comfort functions Suenkler mentions: -(delete-selection-mode 1) -(defalias 'yes-or-no-p 'y-or-n-p) + ;; some comfort functions Suenkler mentions: + (delete-selection-mode 1) + (defalias 'yes-or-no-p 'y-or-n-p) -(show-paren-mode 1) -(setq show-paren-style 'parenthesis) + (show-paren-mode 1) + (setq show-paren-style 'parenthesis) -(column-number-mode nil) + (column-number-mode nil) -(setq org-src-fontify-natively t) + (setq org-src-fontify-natively t) #+end_src #+RESULTS: @@ -108,14 +108,14 @@ Makefile. #+BEGIN_SRC makefile :tangle Makefile -# GNU Make file for the automation of pytest for appendfilename. +# GNU Make file for the automation of pytest for appendfilename # -# While the test script is written for Python 3.9.2, you might need to -# adjust the following instruction once in case your OS includes -# pytest for legacy Python 2 side by side to Python 3, or only hosts -# pytest for Python 3. The tests in script test_appendfilename.py are -# set up to work with pytest for Python 3; dependent on your -# installation, which may be named pytest-3, or (again) pytest. +# While the test script is written for Python 3.9.2, it depends on +# your installation of pytest (and in case of Linux, the authors of +# your distribution) if pytest for Python 3 is invoked either by +# pytest, or pytest-3. In some distributions, pytest actually may +# invoke pyest for legacy Python 2; the tests in test_date2name.py +# however are incompatible to this. # # Put this file like test_appendfilename.py in the root folder of # appendfilename fetched from PyPi or GitHub. Then run @@ -127,8 +127,8 @@ # right after the first test failing, use the -x flag to the # instructions on the CLI in addition to the verbosity flag to (-v). -# pytest -v test_appendfilename.py # only pytest for Python 3 is present -pytest-3 -v test_appendfilename.py # pytest if Python 2 and Python 3 coexist +# pytest -v test_appendfilename.py # the pattern by pytest's manual +pytest-3 -v test_appendfilename.py # the alternative pattern (e.g., Debian 12) #+end_src ** Building a pytest.ini