Level 7 : Consider the following file structure and content. If `python -m unittest discover -s tests` is executed from the `my_project` directory, will `test_standalone_function` be discovered and executed by `unittest`?


# File: my_project/tests/sub_tests/test_feature.py
import unittest

def test_standalone_function():
    """This function is not part of a unittest.TestCase class."""
    pass

class FeatureTest(unittest.TestCase):
    def test_feature_method(self):
        """This method is part of a unittest.TestCase class."""
        pass

Author: Ramya | Tags: test-discovery | 1859+ Python FAQs | Share
syntax-error | opening-files-(open()) | namespace | set | static-method | thread | with-statement | keyword | python-repl | walking-through-directories-using-os.walk() | thread-synchronization | class-and-inheritance | exception-handling | boolean-masking | else | python-syntax-and-structure | gil | object-attribute | working-with-temporary-files-using-tempfile | exponentiation | list-mutation | list,-set,-and-dictionary-comprehensions | destructor | using-os-and-pathlib-modules | intering | mutable | method | init | mapping-function | why-use-multiprocessing-over-threading?-(gil) | difference-between-threads-and-processes | typeerror | list-comprehensions | numpy | bitwise-operator | reading-and-writing-files | error-handling | tuple-unpacking | assignment-operator | sorted | import-method | precedence-and-associativity | objects | call | function | working-with-dates-and-times | complex | sum-function | file | method-overloading | class-and-instance-variable | generators | escape-operator | append | oop | working-with-binary-files-(rb,-wb) | variable | matrix | deep-copy | enumerate() | loop-control | math-copysign | string-method | string-method | precedence | python_version | overflow | tuples | string-formatting | complex-number | error-handling | conversion | list-indexing | lists | package-management | list-join | dicts | interpreter | dataframe-and-series-objects | advanced-file-operations | binary-operation | writing:-write(),-writelines() | using-lists-as-stacks | list-comprehension | multiple-inheritance | using-the-threading-module | module | generator | print | reading:-read(),-readline(),-readlines() | operator-or | arithmetic-operation | datatype | while-and-for-loop | literal-characters-and-special-characters | for | list | access-modifier | multiple-except-blocks | match | methods | class-and-object | else-statement | list-slicing | min-max-function | generators-in-python | boolean | data_structure | thread-safe-data-structures-(queue.queue) | collection | string-manipulation | error | installation | dictionary-methods | loop-control-statements | set-operation | threading | formal-and-actual-parameter | memory-management | floating-point-precision | indexing | string-slicing | string-formatting | collections | arbitrary-arguments-(*args,-**kwargs) | operators | using-join()-and-is_alive()-methods | constructor | aggregating-data-with-functools.reduce() | pass | operator-overloading | zfill-function | data-structure | datetime.date,-datetime.time,-datetime.datetime | python | counter-function | debugging | copy | time-series-with-pandas | loops | shallow-copy | mysql | identity-operator | using-assertions-(assertequal,-assertraises) | list-method | sorting | function-argument | strings | file-handling | filtering-and-indexing | syntax-error | virtual-environment | comment | goto-function | recursion | functions | nested-loop | defining-functions | input-function | factorial-function | pseudocode | library | comprehension | type-conversion | encapsulation | recurssion | postfix | exception | global-variable | def | touples | sum() | polymorphism | list-methods-and-slicing | inherit | parsing-with-strptime | filter-function | tuple | iterable | swapping | int | asyncio | class | join | operations | conditional-statement | decorator | creating-and-starting-threads | sys-module | function-and-scope | while-loops | condition | split | binary | min-function | list-vs-tuple | immutable-data-type | design-principle | __all__-attribute | update | pickling--unpickling | file_handling | return-statement | statement | data-structure | application | head-and-tail | sets | logical-operator | default-mutable-argument | test-discovery | control-flow | python-operators | parameter | python-module | regex | unit-testing | built-in-modules | integers | identity-operators-(is,-is-not) | compute | expression | tuple-methods | docstring | lambda-functions | working-with-file-paths | bitwise | control-flow | logical-operator | functional-programming | operator-and | data-structures-in-python | indexing:-loc-vs-iloc | while-else-loop | single-inheritance | python-history | classes | operator | data-type | string-methods | global-keyword | built-in-function | random | command-line-parsing | string-slicing | identity-operator | dictionary-comprehensions | lambdas | logical-operation | inheritance | default-arguments | numeric | feature | asyncio-module | introduction-to-python | mathematics | creating-custom-modules | fabs-function | turtle | list-operation | overriding-methods | using-yield-in-functions | expand-tab | multiprocessing | dictionary | print-statement | type-conversion | mathematical-function | odd-number | indentation | functional-programming | encoding | yield | version-check | rollback | using-else-and-finally | immutability | formatting-with-strftime | sorting-and-ranking | random-function | matplotlib | while-loop | introduction-to-threads | file-handling | range | input | memory | data-type-conversions | joining-and-merging-dataframes | map-function | handling-missing-values-(fillna,-dropna) | python-django | zip | key-value-pairs | syntaxerror | directory-operations | global-variable | membership-operators-(in,-not-in) | slice | data-structures | logical-operators | type_conversion | counter | reading-and-writing-large-files-efficiently | scientific-notation | list-comprehension | exception-handling | conditional-statement | regular-expression | filter | matrix-list-comprehension | zip-function | version | type-conversion-and-casting | frozenset | lambda-function | pandas | id-function | higher-order-function | identifier | boolean-and-non-boolean | integer | data-type | namedtuple | assert | using-map()-for-transformations | virtual-environment | round-function | floats | raise | async | input-function | global | class-decorators | heap-memory | choice | invalid-list | format | __init_subclass__ | arithmetic-expression | __future__ | control-statement | comparison | iterators | staticmethod | operand | quantifiers-(*,-+,-?,-{}) | math | raise-statement | magic-method | syntax | oops | regular-expressions | introduction-to-multiprocessing | implementation | center | iterator | lambda | loop | multiple-inheritance | sys | attribute | context-manager | dictionaries | pep | decimal | slicing | descriptors | data-types | anchors-(^,-$) | basic | string-iteration | conditional-statements | name-mangling | datetime | software-design | assignment-operators | string-concatenation | string | benefit | round | multithreading | built-in | bitwise-operator | managing-directories-with-os-and-shutil | max-min | booleans | stack | built-in-function | array ...