"The Adventure of the Dying Detective" by Sir Arthur Conan Doyle was first published in 1913 and is part of the continuing saga of the adventures of Dr. Watson and Sherlock Holmes.
In the story, Watson, a doctor and Holmes's sidekick, is summoned to attend Holmes, who appears to be dying of a rare tropical disease. Holmes refuses to let Watson examine him and instead insists that Watson persuade Mr. Culverton Smith to visit his lodgings in Baker Street. It turns out that Mr. Smith murdered his nephew and tried to murder Holmes using a rare tropical disease. Holmes is not actually sick, but he pretends to be sick in order to lure Smith into confessing to his crimes.
The reason Holmes did not let Watson know that he was merely pretending to be sick is simple: Watson is not a skilled liar. As Holmes explains to Watson at the end of the story,
You will realize that among your many talents dissimulation finds no place and that if you had shared my secret, you would never have been able to impress Smith with the urgent necessity of his presence, which was the vital point of the whole scheme.