-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests-python.txt
541 lines (360 loc) · 14.6 KB
/
run-tests-python.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
Running automated test file(s):
===============================================================================
Running: ../../.github/citools/python/python-lint-pylint
Running Python Lint - PyLint
Python versions:
Python 3.12.1
pyenv 2.3.36-21-g7e550e31
pip 24.0 from /home/vpayno/.pyenv/versions/3.12.1/lib/python3.12/site-packages/pip (python 3.12)
PDM, version 2.15.0
==============================================================================
Running: pylint --version
pylint 3.0.3
astroid 3.0.2
Python 3.12.1 (main, Dec 28 2023, 08:22:05) [GCC 10.2.1 20210110]
real 0m0.224s
user 0m0.162s
sys 0m0.064s
==============================================================================
Running: pylint ./src
--------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 10.00/10, +0.00)
real 0m0.644s
user 0m0.557s
sys 0m0.089s
==============================================================================
Exit code: 0
real 0m1.753s
user 0m1.348s
sys 0m0.424s
real 0m1.754s
user 0m1.348s
sys 0m0.426s
===============================================================================
Running: ../../.github/citools/python/python-lint-ruff
Running Python Lint - Ruff
Python versions:
Python 3.12.1
pyenv 2.3.36-21-g7e550e31
pip 24.0 from /home/vpayno/.pyenv/versions/3.12.1/lib/python3.12/site-packages/pip (python 3.12)
PDM, version 2.15.0
==============================================================================
Running: ruff --version
ruff 0.3.5
real 0m0.082s
user 0m0.037s
sys 0m0.048s
==============================================================================
Running: ruff check --ignore E501 ./src
All checks passed!
real 0m0.103s
user 0m0.045s
sys 0m0.062s
==============================================================================
Exit code: 0
real 0m1.075s
user 0m0.733s
sys 0m0.367s
real 0m1.077s
user 0m0.733s
sys 0m0.369s
===============================================================================
Running: ../../.github/citools/python/python-lint-pyright
Running Python Lint - PyRight
Python versions:
Python 3.12.1
pyenv 2.3.36-21-g7e550e31
pip 24.0 from /home/vpayno/.pyenv/versions/3.12.1/lib/python3.12/site-packages/pip (python 3.12)
PDM, version 2.15.0
==============================================================================
Running: pyright --version
pyright 1.1.360
real 0m0.739s
user 0m0.562s
sys 0m0.119s
==============================================================================
Running: pyright --stats ./src
Found 2 source files
pyright 1.1.360
0 errors, 0 warnings, 0 informations
Completed in 0.618sec
Analysis stats
Total files parsed and bound: 22
Total files checked: 2
Timing stats
Find Source Files: 0sec
Read Source Files: 0sec
Tokenize: 0.05sec
Parse: 0.05sec
Resolve Imports: 0.05sec
Bind: 0.04sec
Check: 0.1sec
Detect Cycles: 0sec
real 0m1.266s
user 0m1.319s
sys 0m0.176s
==============================================================================
Exit code: 0
real 0m2.901s
user 0m2.527s
sys 0m0.561s
real 0m2.905s
user 0m2.530s
sys 0m0.561s
===============================================================================
Running: ../../.github/citools/python/python-lint-bandit
Running Python Lint - Bandit
Python versions:
Python 3.12.1
pyenv 2.3.36-21-g7e550e31
pip 24.0 from /home/vpayno/.pyenv/versions/3.12.1/lib/python3.12/site-packages/pip (python 3.12)
PDM, version 2.15.0
==============================================================================
Running: bandit --version
bandit 1.7.7
python version = 3.12.1 (main, Dec 28 2023, 08:22:05) [GCC 10.2.1 20210110]
real 0m0.298s
user 0m0.224s
sys 0m0.075s
==============================================================================
Running: bandit --verbose --recursive ./src
[main] INFO profile include tests: None
[main] INFO profile exclude tests: None
[main] INFO cli include tests: None
[main] INFO cli exclude tests: None
[main] INFO running on Python 3.12.1
Run started:2024-04-27 05:55:22.975208
Files in scope (2):
./src/protein_translation/__init__.py (score: {SEVERITY: 0, CONFIDENCE: 0})
./src/protein_translation/protein_translation.py (score: {SEVERITY: 0, CONFIDENCE: 0})
Files excluded (2):
./src/protein_translation/__pycache__/__init__.cpython-312.pyc
./src/protein_translation/__pycache__/protein_translation.cpython-312.pyc
Test results:
No issues identified.
Code scanned:
Total lines of code: 65
Total lines skipped (#nosec): 0
Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 0
Run metrics:
Total issues (by severity):
Undefined: 0
Low: 0
Medium: 0
High: 0
Total issues (by confidence):
Undefined: 0
Low: 0
Medium: 0
High: 0
Files skipped (0):
real 0m0.236s
user 0m0.161s
sys 0m0.077s
==============================================================================
Exit code: 0
real 0m1.839s
user 0m1.393s
sys 0m0.469s
real 0m1.841s
user 0m1.394s
sys 0m0.470s
===============================================================================
Running: ../../.github/citools/python/python-lint-refurb
Running Python Lint - Refurb
Python versions:
Python 3.12.1
pyenv 2.3.36-21-g7e550e31
pip 24.0 from /home/vpayno/.pyenv/versions/3.12.1/lib/python3.12/site-packages/pip (python 3.12)
PDM, version 2.15.0
==============================================================================
Running: refurb --version
Refurb: v1.26.0
Mypy: v1.9.0
real 0m0.215s
user 0m0.144s
sys 0m0.074s
==============================================================================
Running: refurb --quiet --ignore 183 ./src
real 0m1.173s
user 0m1.098s
sys 0m0.077s
==============================================================================
Exit code: 0
real 0m3.583s
user 0m3.078s
sys 0m0.529s
real 0m3.586s
user 0m3.079s
sys 0m0.531s
===============================================================================
Running: ../../.github/citools/python/python-test-with-doctests
Running Python DocTests
Python versions:
Python 3.12.1
pyenv 2.3.36-21-g7e550e31
pip 24.0 from /home/vpayno/.pyenv/versions/3.12.1/lib/python3.12/site-packages/pip (python 3.12)
PDM, version 2.15.0
==============================================================================
PYTHONPATH="./src"
==============================================================================
Running: python -m doctest -v ./src/protein_translation/__init__.py ./src/protein_translation/protein_translation.py
1 items had no tests:
__init__
0 tests in 1 items.
0 passed and 0 failed.
Test passed.
Trying:
re.match(r"(\w\w\w)", "AUGUUUUCU").groups()
Expecting:
('AUG',)
ok
Trying:
re.findall(r"(\w\w\w)", "AUGUUUUCU")
Expecting:
['AUG', 'UUU', 'UCU']
ok
2 items had no tests:
protein_translation
protein_translation.Proteins
1 items passed all tests:
2 tests in protein_translation.proteins
2 tests in 3 items.
2 passed and 0 failed.
Test passed.
real 0m0.139s
user 0m0.090s
sys 0m0.051s
==============================================================================
Exit code: 0
real 0m1.023s
user 0m0.732s
sys 0m0.308s
real 0m1.025s
user 0m0.732s
sys 0m0.310s
===============================================================================
Running: ../../.github/citools/python/python-test-with-coverage
Running Python Tests With Coverage
Python versions:
Python 3.12.1
pyenv 2.3.36-21-g7e550e31
pip 24.0 from /home/vpayno/.pyenv/versions/3.12.1/lib/python3.12/site-packages/pip (python 3.12)
PDM, version 2.15.0
==============================================================================
Running: rm -rf ./coverage
real 0m0.001s
user 0m0.000s
sys 0m0.001s
==============================================================================
Running: pytest --version
pytest 7.4.3
real 0m0.821s
user 0m0.907s
sys 0m0.806s
==============================================================================
PYTHONPATH="./src"
==============================================================================
Running: pytest --verbose --cov=. --cov-branch --cov-report=term-missing --cov-report=xml:.coverage.xml -p no:randomly ./test
============================= test session starts ==============================
platform linux -- Python 3.12.1, pytest-7.4.3, pluggy-1.3.0 -- /home/vpayno/.pyenv/versions/3.12.1/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/home/vpayno/git_vpayno/exercism-workspace/python/protein-translation/.hypothesis/examples'))
rootdir: /home/vpayno/git_vpayno/exercism-workspace/python/protein-translation
configfile: pytest.ini
plugins: anyio-4.2.0, libtmux-0.25.0, pylama-8.4.1, cov-4.1.0, datafiles-3.0.0, docker-2.0.1, subprocess-1.5.0, typeguard-4.1.5, hypothesis-6.98.17, snapshot-0.9.0
collecting ... collected 25 items
test/protein_translation_test.py::ProteinTranslationTest::test_cysteine_rna_sequence_1 PASSED [ 4%]
test/protein_translation_test.py::ProteinTranslationTest::test_cysteine_rna_sequence_2 PASSED [ 8%]
test/protein_translation_test.py::ProteinTranslationTest::test_leucine_rna_sequence_1 PASSED [ 12%]
test/protein_translation_test.py::ProteinTranslationTest::test_leucine_rna_sequence_2 PASSED [ 16%]
test/protein_translation_test.py::ProteinTranslationTest::test_methionine_rna_sequence PASSED [ 20%]
test/protein_translation_test.py::ProteinTranslationTest::test_phenylalanine_rna_sequence_1 PASSED [ 24%]
test/protein_translation_test.py::ProteinTranslationTest::test_phenylalanine_rna_sequence_2 PASSED [ 28%]
test/protein_translation_test.py::ProteinTranslationTest::test_sequence_of_two_different_protein_codons_translates_into_proteins PASSED [ 32%]
test/protein_translation_test.py::ProteinTranslationTest::test_sequence_of_two_protein_codons_translates_into_proteins PASSED [ 36%]
test/protein_translation_test.py::ProteinTranslationTest::test_serine_rna_sequence_1 PASSED [ 40%]
test/protein_translation_test.py::ProteinTranslationTest::test_serine_rna_sequence_2 PASSED [ 44%]
test/protein_translation_test.py::ProteinTranslationTest::test_serine_rna_sequence_3 PASSED [ 48%]
test/protein_translation_test.py::ProteinTranslationTest::test_serine_rna_sequence_4 PASSED [ 52%]
test/protein_translation_test.py::ProteinTranslationTest::test_stop_codon_rna_sequence_1 PASSED [ 56%]
test/protein_translation_test.py::ProteinTranslationTest::test_stop_codon_rna_sequence_2 PASSED [ 60%]
test/protein_translation_test.py::ProteinTranslationTest::test_stop_codon_rna_sequence_3 PASSED [ 64%]
test/protein_translation_test.py::ProteinTranslationTest::test_translate_rna_strand_into_correct_protein_list PASSED [ 68%]
test/protein_translation_test.py::ProteinTranslationTest::test_translation_stops_if_stop_codon_at_beginning_of_sequence PASSED [ 72%]
test/protein_translation_test.py::ProteinTranslationTest::test_translation_stops_if_stop_codon_at_end_of_three_codon_sequence PASSED [ 76%]
test/protein_translation_test.py::ProteinTranslationTest::test_translation_stops_if_stop_codon_at_end_of_two_codon_sequence PASSED [ 80%]
test/protein_translation_test.py::ProteinTranslationTest::test_translation_stops_if_stop_codon_in_middle_of_six_codon_sequence PASSED [ 84%]
test/protein_translation_test.py::ProteinTranslationTest::test_translation_stops_if_stop_codon_in_middle_of_three_codon_sequence PASSED [ 88%]
test/protein_translation_test.py::ProteinTranslationTest::test_tryptophan_rna_sequence PASSED [ 92%]
test/protein_translation_test.py::ProteinTranslationTest::test_tyrosine_rna_sequence_1 PASSED [ 96%]
test/protein_translation_test.py::ProteinTranslationTest::test_tyrosine_rna_sequence_2 PASSED [100%]
=============================== warnings summary ===============================
../../../../.pyenv/versions/3.12.1/lib/python3.12/site-packages/coverage/pytracer.py:164
/home/vpayno/.pyenv/versions/3.12.1/lib/python3.12/site-packages/coverage/pytracer.py:164: DeprecationWarning: currentThread() is deprecated, use current_thread() instead
self.thread = self.threading.currentThread()
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------- coverage: platform linux, python 3.12.1-final-0 -----------
Name Stmts Miss Branch BrPart Cover Missing
--------------------------------------------------------------------
protein_translation.py 54 6 10 3 86% 44, 47, 54, 79-81, 43->44, 46->47, 53->54
test/__init__.py 0 0 0 0 100%
--------------------------------------------------------------------
TOTAL 54 6 10 3 86%
Coverage XML written to file .coverage.xml
======================== 25 passed, 1 warning in 1.05s =========================
real 0m1.914s
user 0m1.791s
sys 0m0.124s
==============================================================================
Running: coverage report --show-missing
Name Stmts Miss Branch BrPart Cover Missing
--------------------------------------------------------------------
protein_translation.py 54 6 10 3 86% 44, 47, 54, 79-81, 43->44, 46->47, 53->54
test/__init__.py 0 0 0 0 100%
--------------------------------------------------------------------
TOTAL 54 6 10 3 86%
real 0m0.152s
user 0m0.094s
sys 0m0.060s
==============================================================================
Running: coverage annotate
real 0m0.150s
user 0m0.088s
sys 0m0.064s
==============================================================================
Line Coverage: 88.9%
Branch Coverage: 70.0%
==============================================================================
Exit code: 0
real 0m3.962s
user 0m3.549s
sys 0m1.327s
real 0m3.964s
user 0m3.549s
sys 0m1.329s
===============================================================================
tail -n 10000 ./*,cover | grep -E -C 3 '^> def |^! '
> def proteins(rna_sequence: RnaSequenceT) -> ProteinListT:
> r"""Translate RNA to Proteins.
--
> if rna_sequence == "":
! return protein_list
> if len(rna_sequence) % K_CODON_LENGTH != 0:
! return protein_list
--
> if codons is None:
! return protein_list
! codon: CodonSequenceT
> for codon in codons:
--
> protein = Proteins.STOP
! case _:
# or break
! protein = Proteins.STOP
===============================================================================
Running: misspell ./src/protein_translation/__init__.py ./src/protein_translation/protein_translation.py
real 0m0.023s
user 0m0.021s
sys 0m0.011s
===============================================================================